From f82c16b8259e65ffd6a577b526619987b51afa7a Mon Sep 17 00:00:00 2001 From: Mahmoud Ben Hassine Date: Wed, 5 Jul 2023 15:25:51 +0200 Subject: [PATCH] Fix javadoc errors and warnings Resolves #1624 --- pom.xml | 3 +++ spring-batch-core/pom.xml | 8 ++++++++ .../org/springframework/batch/core/Entity.java | 2 +- .../springframework/batch/core/ExitStatus.java | 2 +- .../springframework/batch/core/JobExecution.java | 2 +- .../springframework/batch/core/JobInstance.java | 4 ++-- .../batch/core/JobParameters.java | 2 +- .../batch/core/StepExecutionListener.java | 4 ++-- .../support/DefaultBatchConfiguration.java | 8 +++----- .../GenericApplicationContextFactory.java | 5 +---- .../configuration/xml/ChunkElementParser.java | 2 +- .../xml/CoreNamespacePostProcessor.java | 14 +++++++------- .../configuration/xml/CoreNamespaceUtils.java | 6 +++--- .../configuration/xml/SimpleFlowFactoryBean.java | 6 +++--- .../xml/StepParserStepFactoryBean.java | 2 +- .../core/converter/DateToStringConverter.java | 2 +- .../converter/DefaultJobParametersConverter.java | 8 ++++---- .../converter/JsonJobParametersConverter.java | 8 ++++---- .../LocalDateTimeToStringConverter.java | 2 +- .../converter/LocalDateToStringConverter.java | 2 +- .../converter/LocalTimeToStringConverter.java | 2 +- .../core/converter/StringToDateConverter.java | 2 +- .../converter/StringToLocalDateConverter.java | 2 +- .../StringToLocalDateTimeConverter.java | 2 +- .../converter/StringToLocalTimeConverter.java | 2 +- .../batch/core/explore/JobExplorer.java | 6 +++--- .../explore/support/JobExplorerFactoryBean.java | 2 +- .../batch/core/job/builder/FlowBuilder.java | 2 +- .../batch/core/job/flow/FlowJob.java | 4 ---- .../launch/support/CommandLineJobRunner.java | 2 +- .../support/JobRegistryBackgroundJobRunner.java | 4 ++-- .../core/launch/support/SimpleJobLauncher.java | 4 ++-- .../launch/support/TaskExecutorJobLauncher.java | 4 ++-- .../ExecutionContextPromotionListener.java | 4 ++-- .../batch/core/listener/OrderedComposite.java | 4 ++-- .../core/listener/StepListenerMetaData.java | 4 +++- .../batch/core/observability/BatchMetrics.java | 6 +++--- .../batch/core/repository/JobRepository.java | 8 ++++---- .../repository/dao/JdbcExecutionContextDao.java | 8 ++++---- .../core/repository/dao/JdbcJobExecutionDao.java | 4 ++-- .../repository/dao/JdbcStepExecutionDao.java | 2 +- .../core/repository/dao/JobExecutionDao.java | 6 +++--- .../core/repository/dao/JobInstanceDao.java | 6 +++--- .../core/repository/dao/StepExecutionDao.java | 12 ++++++------ .../repository/support/SimpleJobRepository.java | 2 +- .../step/builder/FaultTolerantStepBuilder.java | 2 +- .../factory/FaultTolerantStepFactoryBean.java | 4 ++-- .../core/step/factory/SimpleStepFactoryBean.java | 4 ++-- .../SimpleSystemProcessExitCodeMapper.java | 4 ++-- .../core/step/tasklet/SystemCommandTasklet.java | 8 ++++---- .../batch/core/job/ExtendedAbstractJobTests.java | 4 ---- .../batch/core/job/JobSupport.java | 2 +- .../batch/core/job/SimpleJobTests.java | 8 +------- .../batch/core/job/flow/FlowJobTests.java | 5 ----- .../core/job/flow/support/SimpleFlowTests.java | 2 +- .../job/flow/support/state/EndStateTests.java | 12 ++---------- .../ExecutionContextPromotionListenerTests.java | 16 ++++++++-------- .../listener/MulticasterBatchListenerTests.java | 13 ++++++------- .../SimpleStepExecutionSplitterTests.java | 3 +-- .../batch/core/step/StepSupport.java | 4 ++-- .../step/builder/RegisterMultiListenerTests.java | 3 +-- .../item/FaultTolerantChunkProcessorTests.java | 1 - .../FaultTolerantStepFactoryBeanRetryTests.java | 1 - .../item/FaultTolerantStepFactoryBeanTests.java | 13 ++++++------- .../step/item/SimpleStepFactoryBeanTests.java | 6 ++---- .../skip/LimitCheckingItemSkipPolicyTests.java | 14 +++++++------- .../tasklet/StepExecutorInterruptionTests.java | 3 --- .../core/step/tasklet/TaskletStepTests.java | 3 +-- .../concurrent/ConcurrentTransactionTests.java | 3 +-- .../HANAJobRepositoryIntegrationTests.java | 8 ++++---- .../OracleJobRepositoryIntegrationTests.java | 3 ++- ...tTolerantStepFactoryBeanIntegrationTests.java | 3 --- ...tStepFactoryBeanRollbackIntegrationTests.java | 3 --- spring-batch-infrastructure/pom.xml | 8 ++++++++ .../batch/item/ExecutionContext.java | 4 ++-- .../batch/item/ItemProcessor.java | 4 ++-- .../adapter/AbstractMethodInvokingDelegator.java | 6 +++--- .../DynamicMethodInvocationException.java | 4 ++-- .../batch/item/avro/AvroItemWriter.java | 2 +- .../data/AbstractPaginatedDataItemReader.java | 2 +- .../batch/item/data/Neo4jItemReader.java | 4 ++-- .../batch/item/data/Neo4jItemWriter.java | 6 +++--- .../data/builder/Neo4jItemReaderBuilder.java | 6 +++--- .../data/builder/Neo4jItemWriterBuilder.java | 6 +++--- .../builder/RepositoryItemWriterBuilder.java | 2 +- .../item/database/AbstractCursorItemReader.java | 2 +- .../ExtendedConnectionDataSourceProxy.java | 2 +- .../item/database/HibernateCursorItemReader.java | 1 - .../batch/item/database/JdbcParameterUtils.java | 6 +++--- .../batch/item/database/JpaCursorItemReader.java | 4 ++-- .../batch/item/database/JpaItemWriter.java | 6 +++--- .../builder/JdbcBatchItemWriterBuilder.java | 4 ++-- .../support/AbstractSqlPagingQueryProvider.java | 6 +++--- ...faultDataFieldMaxValueIncrementerFactory.java | 2 +- .../support/DerbyPagingQueryProvider.java | 4 ++-- .../support/PostgresPagingQueryProvider.java | 4 ++-- .../support/SqlWindowingPagingQueryProvider.java | 2 +- .../batch/item/file/MultiResourceItemReader.java | 2 +- .../batch/item/file/MultiResourceItemWriter.java | 4 ++-- .../file/SimpleBinaryBufferedReaderFactory.java | 3 --- .../file/mapping/BeanWrapperFieldSetMapper.java | 2 +- .../separator/DefaultRecordSeparatorPolicy.java | 10 +++++----- .../item/file/transform/DefaultFieldSet.java | 2 ++ .../SimpleMailMessageItemWriterBuilder.java | 3 ++- ...AbstractItemCountingItemStreamItemReader.java | 4 ++-- .../support/AbstractItemStreamItemReader.java | 2 +- .../support/AbstractItemStreamItemWriter.java | 2 +- .../ClassifierCompositeItemProcessor.java | 4 ++-- .../support/ClassifierCompositeItemWriter.java | 4 ++-- .../batch/item/support/ScriptItemProcessor.java | 4 ++-- .../support/SynchronizedItemStreamReader.java | 10 ++++------ .../support/SynchronizedItemStreamWriter.java | 4 ++-- .../batch/item/xml/StaxEventItemReader.java | 6 +++--- .../batch/item/xml/StaxEventItemWriter.java | 4 ++-- .../context/SynchronizedAttributeAccessor.java | 4 +++- .../interceptor/RepeatOperationsInterceptor.java | 11 ----------- .../batch/repeat/support/ResultHolder.java | 4 +--- .../batch/support/MethodInvokerUtils.java | 7 +++++-- .../TransactionAwareBufferedWriter.java | 4 ++-- .../batch/item/avro/example/AvroTestUtils.java | 3 ++- .../batch/item/avro/example/User.java | 2 +- ...ibernateCursorItemReaderIntegrationTests.java | 4 ++-- .../database/JdbcPagingItemReaderAsyncTests.java | 5 ----- .../database/JpaPagingItemReaderAsyncTests.java | 5 ----- .../batch/item/file/FlatFileItemWriterTests.java | 4 ---- .../batch/item/sample/Customer.java | 4 ++-- .../batch/item/sample/LineItem.java | 4 ++-- .../springframework/batch/item/sample/Order.java | 4 ++-- .../batch/item/sample/Shipper.java | 4 ++-- ...bstractSynchronizedItemStreamWriterTests.java | 3 +-- .../batch/item/xml/StaxEventItemReaderTests.java | 2 +- .../SimpleLimitExceptionHandlerTests.java | 12 ++++-------- .../repeat/support/ItemReaderRepeatCallback.java | 6 +----- ...cutorRepeatTemplateBulkAsynchronousTests.java | 2 +- spring-batch-integration/pom.xml | 8 ++++++++ .../integration/async/AsyncItemProcessor.java | 5 +++-- .../chunk/RemoteChunkingManagerStepBuilder.java | 2 +- .../MessageChannelPartitionHandler.java | 2 +- .../RemotePartitioningManagerStepBuilder.java | 2 +- .../batch/integration/StepSupport.java | 2 +- .../batch/sample/common/StagingItemReader.java | 2 +- .../batch/sample/common/StagingItemWriter.java | 4 ++-- .../domain/order/internal/xml/Customer.java | 4 ++-- .../domain/order/internal/xml/LineItem.java | 4 ++-- .../sample/domain/order/internal/xml/Order.java | 4 ++-- .../domain/order/internal/xml/Shipper.java | 4 ++-- .../batch/sample/mongodb/MongoDBSampleApp.java | 4 ++-- .../batch/sample/RestartFunctionalTests.java | 3 +-- .../batch/sample/common/ErrorLogTasklet.java | 4 ++-- spring-batch-test/pom.xml | 8 ++++++++ .../springframework/batch/test/StepRunner.java | 4 ++-- 151 files changed, 316 insertions(+), 362 deletions(-) diff --git a/pom.xml b/pom.xml index 76e379f517..390eab4dbe 100644 --- a/pom.xml +++ b/pom.xml @@ -87,6 +87,9 @@ 4.9.1 5.9.3 + + 3.0.2 + 1.0.5 diff --git a/spring-batch-core/pom.xml b/spring-batch-core/pom.xml index 3ea77afb08..6527acf379 100644 --- a/spring-batch-core/pom.xml +++ b/spring-batch-core/pom.xml @@ -328,6 +328,14 @@ + + + + com.google.code.findbugs + jsr305 + ${jsr305.version} + provided + diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/Entity.java b/spring-batch-core/src/main/java/org/springframework/batch/core/Entity.java index a662e716d0..5478765bc8 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/Entity.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/Entity.java @@ -39,7 +39,7 @@ public class Entity implements Serializable { /** * Default constructor for {@link Entity}. - * + *

* The ID defaults to zero. */ public Entity() { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/ExitStatus.java b/spring-batch-core/src/main/java/org/springframework/batch/core/ExitStatus.java index 510861f1cd..0464017b2d 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/ExitStatus.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/ExitStatus.java @@ -23,7 +23,7 @@ /** * Value object used to carry information about the status of a job or step execution. - * + *

* {@code ExitStatus} is immutable and, therefore, thread-safe. * * @author Dave Syer diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecution.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecution.java index b4520201b1..fc2096e71b 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecution.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecution.java @@ -305,7 +305,7 @@ public void setCreateTime(LocalDateTime createTime) { /** * Package-private method for re-constituting the step executions from existing * instances. - * @param The {@code stepExecution} execution to be added. + * @param stepExecution The {@code stepExecution} execution to be added. */ void addStepExecution(StepExecution stepExecution) { stepExecutions.add(stepExecution); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobInstance.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobInstance.java index d1211c23a4..6fd343a4e7 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobInstance.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/JobInstance.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ * Batch domain object representing a uniquely identifiable job run. {@code JobInstance} * can be restarted multiple times in case of execution failure, and its lifecycle ends * with first successful execution. - * + *

* Trying to execute an existing {@code JobInstance} that has already completed * successfully results in an error. An error is also raised for an attempt to restart a * failed {@code JobInstance} if the {@code Job} is not restartable. diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobParameters.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobParameters.java index 3589facb14..44078f7db0 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobParameters.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/JobParameters.java @@ -40,7 +40,7 @@ * order to determine if one {@code JobParameters} object equals another. Furthermore, * because these parameters need to be persisted, it is vital that the types added are * restricted. - * + *

* This class is immutable and, therefore, thread-safe. * * @author Lucas Ward diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/StepExecutionListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/StepExecutionListener.java index e4cb6899f0..f1e9a26baf 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/StepExecutionListener.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/StepExecutionListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ default void beforeStep(StepExecution stepExecution) { * Give a listener a chance to modify the exit status from a step. The value returned * is combined with the normal exit status by using * {@link ExitStatus#and(ExitStatus)}. - * + *

* Called after execution of the step's processing logic (whether successful or * failed). Throwing an exception in this method has no effect, as it is only logged. * @param stepExecution a {@link StepExecution} instance. diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultBatchConfiguration.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultBatchConfiguration.java index 438db0d91c..60a89dbf28 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultBatchConfiguration.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultBatchConfiguration.java @@ -74,7 +74,7 @@ /** * Base {@link Configuration} class that provides common JDBC-based infrastructure beans * for enabling and using Spring Batch. - * + *

* This configuration class configures and registers the following beans in the * application context: * @@ -89,10 +89,8 @@ * * * Customization is possible by extending the class and overriding getters. - * - * A typical usage of this class is as follows: - * - *

+ * 

+ * A typical usage of this class is as follows:

  * @Configuration
  * public class MyJobConfiguration extends DefaultBatchConfiguration {
  *
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GenericApplicationContextFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GenericApplicationContextFactory.java
index fb2c87e265..a9074f6671 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GenericApplicationContextFactory.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GenericApplicationContextFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2022 the original author or authors.
+ * Copyright 2006-2023 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -138,9 +138,6 @@ private final class ResourceXmlApplicationContext extends GenericXmlApplicationC
 
 		private final ApplicationContextHelper helper;
 
-		/**
-		 * @param parent
-		 */
 		public ResourceXmlApplicationContext(ConfigurableApplicationContext parent, Object... resources) {
 
 			class ResourceXmlApplicationContextHelper extends ApplicationContextHelper {
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/ChunkElementParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/ChunkElementParser.java
index 15830607da..6c3c13af57 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/ChunkElementParser.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/ChunkElementParser.java
@@ -265,7 +265,7 @@ else if (refElements.size() == 1) {
 
 	/**
 	 * Handle the adapter method attribute by using an
-	 * {@link AbstractMethodInvokingDelegator}.
+	 * {@link org.springframework.batch.item.adapter.AbstractMethodInvokingDelegator}.
 	 */
 	private void handleAdapterMethodAttribute(String propertyName, String adapterClassName,
 			MutablePropertyValues stepPvs, Element element) {
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/CoreNamespacePostProcessor.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/CoreNamespacePostProcessor.java
index a325951a83..7f250d389c 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/CoreNamespacePostProcessor.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/CoreNamespacePostProcessor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2021 the original author or authors.
+ * Copyright 2006-2023 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -60,8 +60,8 @@ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
 	/**
 	 * Automatically inject job-repository from a job into its steps. Only inject if the
 	 * step is an AbstractStep or StepParserStepFactoryBean.
-	 * @param beanName
-	 * @param beanFactory
+	 * @param beanName the bean name
+	 * @param beanFactory the bean factory
 	 */
 	private void injectJobRepositoryIntoSteps(String beanName, ConfigurableListableBeanFactory beanFactory) {
 		BeanDefinition bd = beanFactory.getBeanDefinition(beanName);
@@ -87,8 +87,8 @@ private void injectJobRepositoryIntoSteps(String beanName, ConfigurableListableB
 	/**
 	 * If any of the beans in the parent hierarchy is a <step/> with a
 	 * <tasklet/>, then the bean class must be {@link StepParserStepFactoryBean}.
-	 * @param beanName
-	 * @param beanFactory
+	 * @param beanName the bean name
+	 * @param beanFactory the bean factory
 	 */
 	private void overrideStepClass(String beanName, ConfigurableListableBeanFactory beanFactory) {
 		BeanDefinition bd = beanFactory.getBeanDefinition(beanName);
@@ -111,8 +111,8 @@ public Object postProcessBeforeInitialization(Object bean, String beanName) thro
 	 * 
  • Inject "transactionManager" into any {@link StepParserStepFactoryBean} without * a transactionManager. * - * @param bean - * @return + * @param bean the bean object + * @return the bean with default collaborators injected into it */ private Object injectDefaults(Object bean) { if (bean instanceof JobParserJobFactoryBean) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/CoreNamespaceUtils.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/CoreNamespaceUtils.java index 2b1acc0621..7b3f25581b 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/CoreNamespaceUtils.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/CoreNamespaceUtils.java @@ -103,7 +103,7 @@ private static void checkForScope(ParserContext parserContext, Object source, St /** * Register a {@link Comparator} to be used to sort {@link StateTransition} objects. - * @param parserContext + * @param parserContext the parser context */ private static void addStateTransitionComparator(ParserContext parserContext) { BeanDefinitionRegistry registry = parserContext.getRegistry(); @@ -122,7 +122,7 @@ private static boolean stateTransitionComparatorAlreadyDefined(BeanDefinitionReg /** * Register a {@code RangePropertyEditor}, if one does not already exist. - * @param parserContext + * @param parserContext the parser context */ private static void addRangePropertyEditor(ParserContext parserContext) { BeanDefinitionRegistry registry = parserContext.getRegistry(); @@ -164,7 +164,7 @@ else if (entry.getKey() instanceof String) { /** * Add a core name postprocessor. - * @param parserContext + * @param parserContext the parser context */ private static void addCoreNamespacePostProcessor(ParserContext parserContext) { BeanDefinitionRegistry registry = parserContext.getRegistry(); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/SimpleFlowFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/SimpleFlowFactoryBean.java index 37e7a05ee9..44173bafb9 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/SimpleFlowFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/SimpleFlowFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -137,8 +137,8 @@ private String getNext(String next) { * Convenience method to get a state that proxies the input but with a different name, * appropriate to this flow. If the state is a {@link StepState}, the step name is * also changed. - * @param state - * @return + * @param state the state to proxy + * @return the proxy state */ private State getProxyState(State state) { String oldName = state.getName(); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBean.java index a63b4fb0ff..c3d2a742b6 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBean.java @@ -552,7 +552,7 @@ protected void validateFaultTolerantSettings() { * present). * @param value The value of the other field. * @param twoWayDependency Set to {@code true} if both depend on each other. - * @throws an IllegalArgumentException if either condition is violated + * @throws IllegalArgumentException if either condition is violated */ private void validateDependency(String dependentName, Object dependentValue, String name, Object value, boolean twoWayDependency) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/converter/DateToStringConverter.java b/spring-batch-core/src/main/java/org/springframework/batch/core/converter/DateToStringConverter.java index 1721bbb1ff..698f0cbafd 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/converter/DateToStringConverter.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/converter/DateToStringConverter.java @@ -21,7 +21,7 @@ /** * {@link Converter} implementation from {@link java.util.Date} to {@link String}. - * + *

    * This converter formats dates according to the * {@link java.time.format.DateTimeFormatter#ISO_INSTANT} format. * diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/converter/DefaultJobParametersConverter.java b/spring-batch-core/src/main/java/org/springframework/batch/core/converter/DefaultJobParametersConverter.java index 99df62792e..ab0cfdb6ba 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/converter/DefaultJobParametersConverter.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/converter/DefaultJobParametersConverter.java @@ -32,9 +32,9 @@ /** * Converter for {@link JobParameters} instances that uses a simple naming convention for * converting job parameters. The expected notation is the following: - * + *

    * key=value,type,identifying - * + *

    * where: * *

      @@ -47,12 +47,12 @@ * * For example, schedule.date=2022-12-12,java.time.LocalDate will be converted to an * identifying job parameter of type {@link java.time.LocalDate} with value "2022-12-12". - * + *

      * The literal values are converted to the target type by using the default Spring * conversion service, augmented if necessary by any custom converters. The conversion * service should be configured with a converter to and from string literals to job * parameter types. - * + *

      * By default, the Spring conversion service is augmented to support the conversion of the * following types: * diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/converter/JsonJobParametersConverter.java b/spring-batch-core/src/main/java/org/springframework/batch/core/converter/JsonJobParametersConverter.java index c1dbe27926..bc1834738b 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/converter/JsonJobParametersConverter.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/converter/JsonJobParametersConverter.java @@ -24,10 +24,10 @@ /** * Converter for {@link JobParameters} instances that uses a JSON naming convention for * converting job parameters. The expected notation is the following: - * + *

      * key='{"value": "parameterStringLiteralValue", * "type":"fully.qualified.name.of.the.parameter.Type", "identifying": "booleanValue"}' - * + *

      * where: * *

        @@ -41,12 +41,12 @@ * For example, schedule.date={"value": "2022-12-12", "type":"java.time.LocalDate", * "identifying": "false"} will be converted to a non identifying job parameter of type * {@link java.time.LocalDate} with value "2022-12-12". - * + *

        * The literal values are converted to the correct type by using the default Spring * conversion service, augmented if necessary by any custom converters. The conversion * service should be configured with a converter to and from string literals to job * parameter types. - * + *

        * By default, the Spring conversion service is augmented to support the conversion of the * following types: * diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/converter/LocalDateTimeToStringConverter.java b/spring-batch-core/src/main/java/org/springframework/batch/core/converter/LocalDateTimeToStringConverter.java index 4c68325a1e..e434b68af6 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/converter/LocalDateTimeToStringConverter.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/converter/LocalDateTimeToStringConverter.java @@ -22,7 +22,7 @@ /** * {@link Converter} implementation from {@link LocalDateTime} to {@link String}. - * + *

        * This converter formats dates according to the * {@link DateTimeFormatter#ISO_LOCAL_DATE_TIME} format. * diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/converter/LocalDateToStringConverter.java b/spring-batch-core/src/main/java/org/springframework/batch/core/converter/LocalDateToStringConverter.java index 7d9f875d5c..af38941b23 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/converter/LocalDateToStringConverter.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/converter/LocalDateToStringConverter.java @@ -21,7 +21,7 @@ /** * {@link Converter} implementation from {@link LocalDate} to {@link String}. - * + *

        * This converter formats dates according to the * {@link java.time.format.DateTimeFormatter#ISO_LOCAL_DATE} format. * diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/converter/LocalTimeToStringConverter.java b/spring-batch-core/src/main/java/org/springframework/batch/core/converter/LocalTimeToStringConverter.java index 70be128348..077614b503 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/converter/LocalTimeToStringConverter.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/converter/LocalTimeToStringConverter.java @@ -22,7 +22,7 @@ /** * {@link Converter} implementation from {@link LocalTime} to {@link String}. - * + *

        * This converter formats times according to the {@link DateTimeFormatter#ISO_LOCAL_TIME} * format. * diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/converter/StringToDateConverter.java b/spring-batch-core/src/main/java/org/springframework/batch/core/converter/StringToDateConverter.java index 2015ec6095..1c31221fc0 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/converter/StringToDateConverter.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/converter/StringToDateConverter.java @@ -22,7 +22,7 @@ /** * {@link Converter} implementation from {@link String} to {@link java.util.Date}. - * + *

        * This converter expects strings in the * {@link java.time.format.DateTimeFormatter#ISO_INSTANT} format. * diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/converter/StringToLocalDateConverter.java b/spring-batch-core/src/main/java/org/springframework/batch/core/converter/StringToLocalDateConverter.java index f35a6e1c7d..ddf1dafd8e 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/converter/StringToLocalDateConverter.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/converter/StringToLocalDateConverter.java @@ -21,7 +21,7 @@ /** * {@link Converter} implementation from {@link String} to {@link LocalDate}. - * + *

        * This converter expects strings in the * {@link java.time.format.DateTimeFormatter#ISO_LOCAL_DATE} format. * diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/converter/StringToLocalDateTimeConverter.java b/spring-batch-core/src/main/java/org/springframework/batch/core/converter/StringToLocalDateTimeConverter.java index 5f1eb343f7..3ea8dbabac 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/converter/StringToLocalDateTimeConverter.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/converter/StringToLocalDateTimeConverter.java @@ -21,7 +21,7 @@ /** * {@link Converter} implementation from {@link String} to {@link LocalDateTime}. - * + *

        * This converter expects strings in the * {@link java.time.format.DateTimeFormatter#ISO_LOCAL_DATE_TIME} format. * diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/converter/StringToLocalTimeConverter.java b/spring-batch-core/src/main/java/org/springframework/batch/core/converter/StringToLocalTimeConverter.java index 0b3c2ef111..3b56e22350 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/converter/StringToLocalTimeConverter.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/converter/StringToLocalTimeConverter.java @@ -21,7 +21,7 @@ /** * {@link Converter} implementation from {@link String} to {@link LocalTime}. - * + *

        * This converter expects strings in the * {@link java.time.format.DateTimeFormatter#ISO_LOCAL_TIME} format. * diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/explore/JobExplorer.java b/spring-batch-core/src/main/java/org/springframework/batch/core/explore/JobExplorer.java index 05ea95b6df..85c69655f9 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/explore/JobExplorer.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/explore/JobExplorer.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -113,7 +113,7 @@ default JobInstance getJobInstance(String jobName, JobParameters jobParameters) * depending on the implementation. In that case, use * {@link #getStepExecution(Long, Long)} to hydrate them. * @param jobInstance The {@link JobInstance} to query. - * @return the set of all executions for the specified {@link JobInstance}. + * @return the list of all executions for the specified {@link JobInstance}. */ List getJobExecutions(JobInstance jobInstance); @@ -145,7 +145,7 @@ default JobExecution getLastJobExecution(JobInstance jobInstance) { /** * Query the repository for all unique {@link JobInstance} names (sorted * alphabetically). - * @return the set of job names that have been executed. + * @return the list of job names that have been executed. */ List getJobNames(); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/JobExplorerFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/JobExplorerFactoryBean.java index 09f2d4d43e..c05ad5c137 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/JobExplorerFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/JobExplorerFactoryBean.java @@ -98,7 +98,7 @@ public void setSerializer(ExecutionContextSerializer serializer) { /** * Sets the data source. - * + *

        * Public setter for the {@link DataSource}. * @param dataSource A {@code DataSource}. */ diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/builder/FlowBuilder.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/builder/FlowBuilder.java index c105a795c1..dde3e6571c 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/builder/FlowBuilder.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/builder/FlowBuilder.java @@ -572,7 +572,7 @@ public FlowBuilder fail() { * * In this example, a flow consisting of step1 will be executed in * parallel with flow. - * + *

        * Note: Adding a split to a chain of states is not supported. For example, * the following configuration is not supported. Instead, the configuration would need * to create a flow3 that was the split flow and assemble them separately. diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/FlowJob.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/FlowJob.java index 114d0af8de..33e2f491fe 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/FlowJob.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/FlowJob.java @@ -88,10 +88,6 @@ private void init() { initialized = true; } - /** - * @param flow - * @param map - */ private void findSteps(Flow flow, Map map) { for (State state : flow.getStates()) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/CommandLineJobRunner.java b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/CommandLineJobRunner.java index 53a8366bae..e39ad413e2 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/CommandLineJobRunner.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/CommandLineJobRunner.java @@ -385,7 +385,7 @@ int start(String jobPath, String jobIdentifier, String[] parameters, Set /** * @param jobIdentifier a job execution id or job name * @param minStatus the highest status to exclude from the result - * @return + * @return the list of job executions with status greater than minStatus */ private List getJobExecutionsWithStatusGreaterThan(String jobIdentifier, BatchStatus minStatus) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/JobRegistryBackgroundJobRunner.java b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/JobRegistryBackgroundJobRunner.java index 9a47c60853..da01a1af5b 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/JobRegistryBackgroundJobRunner.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/JobRegistryBackgroundJobRunner.java @@ -172,7 +172,7 @@ private void maybeCreateJobLoader() { * and followed by the children. The parent must contain a {@link JobRegistry} and the * child contexts are expected to contain {@link Job} definitions, each of which will * be registered wit the registry. - * + *

        * Example usage: * *

        @@ -182,7 +182,7 @@ private void maybeCreateJobLoader() {
         	 * The child contexts are created only when needed though the {@link JobFactory}
         	 * interface (but the XML is validated on startup by using it to create a
         	 * {@link BeanFactory} which is then discarded).
        -	 *
        +	 * 

        * The parent context is created in a separate thread, and the program will pause for * input in an infinite loop until the user hits any key. * @param args the context locations to use (first one is for parent) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleJobLauncher.java b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleJobLauncher.java index 744e64e427..6369c092b3 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleJobLauncher.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleJobLauncher.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,7 @@ * Care should be taken to ensure any users of this class understand fully whether or not * the implementation of TaskExecutor used will start tasks synchronously or * asynchronously. The default setting uses a synchronous task executor. - * + *

        * There is only one required dependency of this Launcher, a {@link JobRepository}. The * JobRepository is used to obtain a valid JobExecution. The Repository must be used * because the provided {@link Job} could be a restart of an existing {@link JobInstance}, diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/TaskExecutorJobLauncher.java b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/TaskExecutorJobLauncher.java index 98ee2bb8b6..fe003d3d44 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/TaskExecutorJobLauncher.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/TaskExecutorJobLauncher.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 the original author or authors. + * Copyright 2022-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ * of this class understand fully whether or not the implementation of TaskExecutor used * will start tasks synchronously or asynchronously. The default setting uses a * synchronous task executor. - * + *

        * There is only one required dependency of this Launcher, a {@link JobRepository}. The * JobRepository is used to obtain a valid JobExecution. The Repository must be used * because the provided {@link Job} could be a restart of an existing {@link JobInstance}, diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/ExecutionContextPromotionListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/ExecutionContextPromotionListener.java index 4abfa685c7..525dc86b92 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/ExecutionContextPromotionListener.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/ExecutionContextPromotionListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,7 @@ * {@link ExecutionContext} to the {@link Job} {@link ExecutionContext} at the end of a * step. A list of keys should be provided that correspond to the items in the * {@link Step} {@link ExecutionContext} that should be promoted. - * + *

        * Additionally, an optional list of statuses can be set to indicate for which exit status * codes the promotion should occur. These statuses will be checked using the * {@link PatternMatcher}, so wildcards are allowed. By default, promotion will only occur diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/OrderedComposite.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/OrderedComposite.java index 9bb9a5b0a5..abd24cbc77 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/OrderedComposite.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/OrderedComposite.java @@ -43,7 +43,7 @@ class OrderedComposite { /** * Public setter for the listeners. - * @param items + * @param items to set */ public void setItems(List items) { unordered.clear(); @@ -55,7 +55,7 @@ public void setItems(List items) { /** * Register additional item. - * @param item + * @param item to add */ public void add(S item) { if (item instanceof Ordered) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/StepListenerMetaData.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/StepListenerMetaData.java index cb18878efc..943497828f 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/StepListenerMetaData.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/StepListenerMetaData.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,6 +46,7 @@ import org.springframework.batch.core.annotation.OnWriteError; import org.springframework.batch.core.scope.context.ChunkContext; import org.springframework.batch.item.Chunk; +import org.springframework.lang.Nullable; /** * Enumeration for {@link StepListener} meta data, which ties together the names of @@ -140,6 +141,7 @@ public String getPropertyName() { * @param propertyName property name to retrieve data for. * @return meta data with supplied property name, null if none exists. */ + @Nullable public static StepListenerMetaData fromPropertyName(String propertyName) { return propertyMap.get(propertyName); } diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/observability/BatchMetrics.java b/spring-batch-core/src/main/java/org/springframework/batch/core/observability/BatchMetrics.java index 117b13d5b5..a0d6196b1a 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/observability/BatchMetrics.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/observability/BatchMetrics.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2022 the original author or authors. + * Copyright 2019-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -93,7 +93,7 @@ public static Counter createCounter(MeterRegistry meterRegistry, String name, St /** * Create a new {@link Observation}. It's not started, you must explicitly call * {@link Observation#start()} to start it. - * + *

        * Remember to register the {@link DefaultMeterObservationHandler} via the * {@code Metrics.globalRegistry.withTimerObservationHandler()} in the user code. * Otherwise you won't observe any metrics. @@ -110,7 +110,7 @@ public static Observation createObservation(String name, BatchJobContext context /** * Create a new {@link Observation}. It's not started, you must explicitly call * {@link Observation#start()} to start it. - * + *

        * Remember to register the {@link DefaultMeterObservationHandler} via the * {@code Metrics.globalRegistry.withTimerObservationHandler()} in the user code. * Otherwise you won't observe any metrics. diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/JobRepository.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/JobRepository.java index 6d7bcf03e5..b8db9253b2 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/JobRepository.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/JobRepository.java @@ -137,7 +137,7 @@ JobExecution createJobExecution(String jobName, JobParameters jobParameters) /** * Update the {@link JobExecution} (but not its {@link ExecutionContext}). - * + *

        * Preconditions: {@link JobExecution} must contain a valid {@link JobInstance} and be * saved (have an id assigned). * @param jobExecution {@link JobExecution} instance to be updated in the repo. @@ -148,7 +148,7 @@ JobExecution createJobExecution(String jobName, JobParameters jobParameters) * Save the {@link StepExecution} and its {@link ExecutionContext}. ID will be * assigned - it is not permitted that an ID be assigned before calling this method. * Instead, it should be left blank, to be assigned by a {@link JobRepository}. - * + *

        * Preconditions: {@link StepExecution} must have a valid {@link Step}. * @param stepExecution {@link StepExecution} instance to be added to the repo. */ @@ -159,7 +159,7 @@ JobExecution createJobExecution(String jobName, JobParameters jobParameters) * StepExecution ID will be assigned - it is not permitted that an ID be assigned * before calling this method. Instead, it should be left blank, to be assigned by * {@link JobRepository}. - * + *

        * Preconditions: {@link StepExecution} must have a valid {@link Step}. * @param stepExecutions collection of {@link StepExecution} instances to be added to * the repo. @@ -168,7 +168,7 @@ JobExecution createJobExecution(String jobName, JobParameters jobParameters) /** * Update the {@link StepExecution} (but not its {@link ExecutionContext}). - * + *

        * Preconditions: {@link StepExecution} must be saved (have an id assigned). * @param stepExecution {@link StepExecution} instance to be updated in the repo. */ diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcExecutionContextDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcExecutionContextDao.java index 91e1903fbd..3276c46b59 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcExecutionContextDao.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcExecutionContextDao.java @@ -45,7 +45,7 @@ /** * JDBC DAO for {@link ExecutionContext}. - * + *

        * Stores execution context data related to both Step and Job using a different table for * each. * @@ -269,8 +269,8 @@ public void afterPropertiesSet() throws Exception { } /** - * @param executionId - * @param serializedContext + * @param executionId the job or step execution id + * @param serializedContext the serialized context to persist * @param sql with parameters (shortContext, longContext, executionId) */ private void persistSerializedContext(final Long executionId, String serializedContext, String sql) { @@ -301,7 +301,7 @@ private void persistSerializedContext(final Long executionId, String serializedC } /** - * @param serializedContexts + * @param serializedContexts the execution contexts to serialize * @param sql with parameters (shortContext, longContext, executionId) */ private void persistSerializedContexts(final Map serializedContexts, String sql) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobExecutionDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobExecutionDao.java index c0b5cf4a31..a772373dbf 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobExecutionDao.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobExecutionDao.java @@ -249,8 +249,8 @@ public void saveJobExecution(JobExecution jobExecution) { /** * Validate JobExecution. At a minimum, JobId, Status, CreateTime cannot be null. - * @param jobExecution - * @throws IllegalArgumentException + * @param jobExecution the job execution to validate + * @throws IllegalArgumentException if the job execution is invalid */ private void validateJobExecution(JobExecution jobExecution) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcStepExecutionDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcStepExecutionDao.java index 7fe73f0bfd..c486a067b4 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcStepExecutionDao.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcStepExecutionDao.java @@ -233,7 +233,7 @@ private List buildStepExecutionParameters(StepExecution stepExecution) /** * Validate StepExecution. At a minimum, JobId, CreateTime, and Status cannot be null. * EndTime can be null for an unfinished job. - * @throws IllegalArgumentException + * @throws IllegalArgumentException if the step execution is invalid */ private void validateStepExecution(StepExecution stepExecution) { Assert.notNull(stepExecution, "stepExecution is required"); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JobExecutionDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JobExecutionDao.java index ca72abbb2a..ec8da0c7a6 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JobExecutionDao.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JobExecutionDao.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ public interface JobExecutionDao { /** * Save a new JobExecution. - * + *

        * Preconditions: jobInstance the jobExecution belongs to must have a jobInstanceId. * @param jobExecution {@link JobExecution} instance to be saved. */ @@ -42,7 +42,7 @@ public interface JobExecutionDao { /** * Update and existing JobExecution. - * + *

        * Preconditions: jobExecution must have an Id (which can be obtained by the save * method) and a jobInstanceId. * @param jobExecution {@link JobExecution} instance to be updated. diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JobInstanceDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JobInstanceDao.java index ea857a99d0..4c2ac43be4 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JobInstanceDao.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JobInstanceDao.java @@ -37,9 +37,9 @@ public interface JobInstanceDao { /** * Create a JobInstance with given name and parameters. - * + *

        * PreConditions: JobInstance for given name and parameters must not already exist - * + *

        * PostConditions: A valid job instance will be returned which has been persisted and * contains an unique Id. * @param jobName {@link String} containing the name of the job. @@ -80,7 +80,7 @@ public interface JobInstanceDao { /** * Fetch the last job instances with the provided name, sorted backwards by primary * key. - * + *

        * if using the JdbcJobInstance, you can provide the jobName with a wildcard (e.g. * *Job) to return 'like' job names. (e.g. *Job will return 'someJob' and 'otherJob') * @param jobName the job name diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/StepExecutionDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/StepExecutionDao.java index 88358521b6..58e43bd8ef 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/StepExecutionDao.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/StepExecutionDao.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,9 +27,9 @@ public interface StepExecutionDao { /** * Save the given StepExecution. - * + *

        * Preconditions: Id must be null. - * + *

        * Postconditions: Id will be set to a unique Long. * @param stepExecution {@link StepExecution} instance to be saved. */ @@ -37,9 +37,9 @@ public interface StepExecutionDao { /** * Save the given collection of StepExecution as a batch. - * + *

        * Preconditions: StepExecution Id must be null. - * + *

        * Postconditions: StepExecution Id will be set to a unique Long. * @param stepExecutions a collection of {@link JobExecution} instances to be saved. */ @@ -47,7 +47,7 @@ public interface StepExecutionDao { /** * Update the given StepExecution - * + *

        * Preconditions: Id must not be null. * @param stepExecution {@link StepExecution} instance to be updated. */ diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/SimpleJobRepository.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/SimpleJobRepository.java index 4b79eb0a64..20eaacafe6 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/SimpleJobRepository.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/SimpleJobRepository.java @@ -283,7 +283,7 @@ public long getStepExecutionCount(JobInstance jobInstance, String stepName) { * provided StepExecution has been interrupted. If, after synchronizing the status * with the database, the status has been updated to STOPPING, then the job has been * interrupted. - * @param stepExecution + * @param stepExecution the step execution */ private void checkForInterruption(StepExecution stepExecution) { JobExecution jobExecution = stepExecution.getJobExecution(); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/builder/FaultTolerantStepBuilder.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/builder/FaultTolerantStepBuilder.java index 7dca854e63..ba0c63d7f0 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/builder/FaultTolerantStepBuilder.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/builder/FaultTolerantStepBuilder.java @@ -689,7 +689,7 @@ private void addNonRetryableExceptionIfMissing(Class... cls /** * ChunkListener that wraps exceptions thrown from the ChunkListener in * {@link FatalStepExecutionException} to force termination of StepExecution - * + *

        * ChunkListeners shoulnd't throw exceptions and expect continued processing, they * must be handled in the implementation or the step will terminate * diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/factory/FaultTolerantStepFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/factory/FaultTolerantStepFactoryBean.java index ae4c6d7ec7..48aed1eae5 100755 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/factory/FaultTolerantStepFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/factory/FaultTolerantStepFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ * Factory bean for step that provides options for configuring skip behavior. User can set * {@link #setSkipLimit(int)} to set how many exceptions of * {@link #setSkippableExceptionClasses(Map)} types are tolerated. - * + *

        * Skippable exceptions on write will by default cause transaction rollback - to avoid * rollback for specific exception class include it in the transaction attribute as "no * rollback for". diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/factory/SimpleStepFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/factory/SimpleStepFactoryBean.java index cb25af7c2f..a915462295 100755 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/factory/SimpleStepFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/factory/SimpleStepFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,7 @@ /** * Most common configuration options for simple steps should be found here. Use this * factory bean instead of creating a {@link Step} implementation manually. - * + *

        * This factory does not support configuration of fault-tolerant behavior, use appropriate * subclass of this factory bean to configure skip or retry. * diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/tasklet/SimpleSystemProcessExitCodeMapper.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/tasklet/SimpleSystemProcessExitCodeMapper.java index 651b9ff177..1685914c1a 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/tasklet/SimpleSystemProcessExitCodeMapper.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/tasklet/SimpleSystemProcessExitCodeMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2013 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ /** * Simple {@link SystemProcessExitCodeMapper} implementation that performs following * mapping: - * + *

        * 0 -> ExitStatus.FINISHED else -> ExitStatus.FAILED * * @author Robert Kasanicky diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/tasklet/SystemCommandTasklet.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/tasklet/SystemCommandTasklet.java index a980ceb8cc..b35a228a4d 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/tasklet/SystemCommandTasklet.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/tasklet/SystemCommandTasklet.java @@ -41,18 +41,18 @@ /** * {@link Tasklet} that executes a system command. - * + *

        * The system command is executed asynchronously using injected * {@link #setTaskExecutor(TaskExecutor)} - timeout value is required to be set, so that * the batch job does not hang forever if the external process hangs. - * + *

        * Tasklet periodically checks for termination status (i.e. {@link #setCommand(String...)} * finished its execution or {@link #setTimeout(long)} expired or job was interrupted). * The check interval is given by {@link #setTerminationCheckInterval(long)}. - * + *

        * When job interrupt is detected tasklet's execution is terminated immediately by * throwing {@link JobInterruptedException}. - * + *

        * {@link #setInterruptOnCancel(boolean)} specifies whether the tasklet should attempt to * interrupt the thread that executes the system command if it is still running when * tasklet exits (abnormally). diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/job/ExtendedAbstractJobTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/job/ExtendedAbstractJobTests.java index fc26f91ec8..79a5684b1f 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/job/ExtendedAbstractJobTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/job/ExtendedAbstractJobTests.java @@ -194,10 +194,6 @@ public void execute(StepExecution stepExecution) throws JobInterruptedException */ private static class StubJob extends AbstractJob { - /** - * @param name - * @param jobRepository - */ private StubJob(String name, JobRepository jobRepository) { super(name); try { diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/job/JobSupport.java b/spring-batch-core/src/test/java/org/springframework/batch/core/job/JobSupport.java index 53d25ef991..7d1fee79c0 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/job/JobSupport.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/job/JobSupport.java @@ -63,7 +63,7 @@ public JobSupport() { /** * Convenience constructor to immediately add name (which is mandatory but not final). - * @param name + * @param name the job name */ public JobSupport(String name) { super(); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/job/SimpleJobTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/job/SimpleJobTests.java index 9f99e445b8..ff0ea2a720 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/job/SimpleJobTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/job/SimpleJobTests.java @@ -544,23 +544,17 @@ private static class StubStep extends StepSupport { private ExecutionContext passedInJobContext; /** - * @param string + * @param string the step name */ public StubStep(String string, JobRepository jobRepository) { super(string); this.jobRepository = jobRepository; } - /** - * @param exception - */ public void setProcessException(Throwable exception) { this.exception = exception; } - /** - * @param runnable - */ public void setCallback(Runnable runnable) { this.runnable = runnable; } diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/job/flow/FlowJobTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/job/flow/FlowJobTests.java index 3696ed18dc..349497096f 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/job/flow/FlowJobTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/job/flow/FlowJobTests.java @@ -702,11 +702,6 @@ public void execute(StepExecution stepExecution) throws JobInterruptedException } - /** - * @param jobExecution - * @param stepName - * @return the StepExecution corresponding to the specified step - */ private StepExecution getStepExecution(JobExecution jobExecution, String stepName) { for (StepExecution stepExecution : jobExecution.getStepExecutions()) { if (stepExecution.getStepName().equals(stepName)) { diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/job/flow/support/SimpleFlowTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/job/flow/support/SimpleFlowTests.java index b1f7e1b924..0cdc2b8422 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/job/flow/support/SimpleFlowTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/job/flow/support/SimpleFlowTests.java @@ -220,7 +220,7 @@ protected List collect(StateTransition... states) { protected static class StubState extends StateSupport { /** - * @param string + * @param string the state name */ public StubState(String string) { super(string); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/job/flow/support/state/EndStateTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/job/flow/support/state/EndStateTests.java index 5c5a56d4f5..ada6772359 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/job/flow/support/state/EndStateTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/job/flow/support/state/EndStateTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,11 +22,11 @@ import org.springframework.batch.core.BatchStatus; import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.job.flow.FlowExecutionStatus; -import org.springframework.batch.core.job.flow.FlowExecutor; import org.springframework.batch.core.job.flow.support.JobFlowExecutorSupport; /** * @author Dave Syer + * @author Mahmoud Ben Hassine * */ class EndStateTests { @@ -38,10 +38,6 @@ void setUp() { jobExecution = new JobExecution(0L); } - /** - * Test method for {@link EndState#handle(FlowExecutor)}. - * @throws Exception - */ @Test void testHandleRestartSunnyDay() throws Exception { @@ -59,10 +55,6 @@ public JobExecution getJobExecution() { } - /** - * Test method for {@link EndState#handle(FlowExecutor)}. - * @throws Exception - */ @Test void testHandleOngoingSunnyDay() throws Exception { diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/listener/ExecutionContextPromotionListenerTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/listener/ExecutionContextPromotionListenerTests.java index 7544e0c144..b0100489b0 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/listener/ExecutionContextPromotionListenerTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/listener/ExecutionContextPromotionListenerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2022 the original author or authors. + * Copyright 2009-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ class ExecutionContextPromotionListenerTests { /** * CONDITION: ExecutionContext contains {key, key2}. keys = {key}. statuses is not set * (defaults to {COMPLETED}). - * + *

        * EXPECTED: key is promoted. key2 is not. */ @Test @@ -77,7 +77,7 @@ void promoteEntryNullStatuses() throws Exception { /** * CONDITION: ExecutionContext contains {key, key2}. keys = {key, key2}. statuses = * {status}. ExitStatus = status - * + *

        * EXPECTED: key is promoted. key2 is not. */ @Test @@ -108,7 +108,7 @@ void promoteEntryStatusFound() throws Exception { /** * CONDITION: ExecutionContext contains {key, key2}. keys = {key, key2}. statuses = * {status}. ExitStatus = status2 - * + *

        * EXPECTED: no promotions. */ @Test @@ -137,7 +137,7 @@ void promoteEntryStatusNotFound() throws Exception { /** * CONDITION: keys = {key, key2}. statuses = {statusWildcard}. ExitStatus = status - * + *

        * EXPECTED: key is promoted. key2 is not. */ @Test @@ -166,7 +166,7 @@ void promoteEntryStatusWildcardFound() throws Exception { /** * CONDITION: keys = {key, key2}. Only {key} exists in the ExecutionContext. - * + *

        * EXPECTED: key is promoted. key2 is not. */ @Test @@ -193,7 +193,7 @@ void promoteEntriesKeyNotFound() throws Exception { /** * CONDITION: keys = {key}. key is already in job but not in step. - * + *

        * EXPECTED: key is not erased. */ @Test @@ -220,7 +220,7 @@ void promoteEntriesKeyNotFoundInStep() throws Exception { /** * CONDITION: strict = true. keys = {key, key2}. Only {key} exists in the * ExecutionContext. - * + *

        * EXPECTED: IllegalArgumentException */ @Test diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/listener/MulticasterBatchListenerTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/listener/MulticasterBatchListenerTests.java index 68a90fdb43..d87de812b7 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/listener/MulticasterBatchListenerTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/listener/MulticasterBatchListenerTests.java @@ -20,7 +20,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; -import java.util.List; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -264,7 +263,7 @@ void testOnReadErrorFails() { /** * Test method for - * {@link org.springframework.batch.core.listener.MulticasterBatchListener#afterWrite(java.util.List)} + * {@link org.springframework.batch.core.listener.MulticasterBatchListener#afterWrite(Chunk)} * . */ @Test @@ -275,7 +274,7 @@ void testAfterWrite() { /** * Test method for - * {@link org.springframework.batch.core.listener.MulticasterBatchListener#afterWrite(java.util.List)} + * {@link org.springframework.batch.core.listener.MulticasterBatchListener#afterWrite(Chunk)} * . */ @Test @@ -289,7 +288,7 @@ void testAfterWriteFails() { /** * Test method for - * {@link org.springframework.batch.core.listener.MulticasterBatchListener#beforeWrite(List)} + * {@link org.springframework.batch.core.listener.MulticasterBatchListener#beforeWrite(Chunk)} * . */ @Test @@ -300,7 +299,7 @@ void testBeforeWrite() { /** * Test method for - * {@link org.springframework.batch.core.listener.MulticasterBatchListener#beforeWrite(List)} + * {@link org.springframework.batch.core.listener.MulticasterBatchListener#beforeWrite(Chunk)} * . */ @Test @@ -314,7 +313,7 @@ void testBeforeWriteFails() { /** * Test method for - * {@link org.springframework.batch.core.listener.MulticasterBatchListener#onWriteError(Exception, java.util.List)} + * {@link org.springframework.batch.core.listener.MulticasterBatchListener#onWriteError(Exception, Chunk)} * . */ @Test @@ -325,7 +324,7 @@ void testOnWriteError() { /** * Test method for - * {@link org.springframework.batch.core.listener.MulticasterBatchListener#onWriteError(Exception, java.util.List)} + * {@link org.springframework.batch.core.listener.MulticasterBatchListener#onWriteError(Exception, Chunk)} * . */ @Test diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/partition/support/SimpleStepExecutionSplitterTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/partition/support/SimpleStepExecutionSplitterTests.java index eb848ce84b..2a17a56645 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/partition/support/SimpleStepExecutionSplitterTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/partition/support/SimpleStepExecutionSplitterTests.java @@ -80,9 +80,8 @@ void testSimpleStepExecutionProviderJobRepositoryStep() throws Exception { } } - /** + /* * Tests the results of BATCH-2490 - * @throws Exception */ @Test void testAddressabilityOfSetResults() throws Exception { diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/StepSupport.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/StepSupport.java index 057c07d877..571b199c5f 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/StepSupport.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/StepSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2013 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ public StepSupport() { } /** - * @param string + * @param string the step name */ public StepSupport(String string) { super(); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/builder/RegisterMultiListenerTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/builder/RegisterMultiListenerTests.java index 85d1bf015c..83292b4f56 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/builder/RegisterMultiListenerTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/builder/RegisterMultiListenerTests.java @@ -88,12 +88,11 @@ void tearDown() { } } - /** + /* * The times the beforeChunkCalled occurs are: - Before chunk 1 (item1, item2) - * Before the re-attempt of item1 (scanning) - Before the re-attempt of item2 * (scanning) - Before the checking that scanning is complete - Before chunk 2 (item3, * item4) - Before chunk 3 (null) - * @throws Exception */ @Test void testMultiListenerFaultTolerantStep() throws Exception { diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantChunkProcessorTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantChunkProcessorTests.java index c87631b717..5070b277a4 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantChunkProcessorTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantChunkProcessorTests.java @@ -185,7 +185,6 @@ public String process(String item) throws Exception { /** * An Error can be retried or skipped but by default it is just propagated - * @throws Exception */ @Test void testWriteSkipOnError() throws Exception { diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRetryTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRetryTests.java index 0794818416..84cb8a0449 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRetryTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRetryTests.java @@ -275,7 +275,6 @@ public String process(String item) throws Exception { * N.B. this doesn't really test retry, since the retry is only on write failures, but * it does test that read errors are re-presented for another try when the retryLimit * is high enough (it is used to build an exception handler). - * @throws Exception */ @SuppressWarnings("unchecked") @Test diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanTests.java index e678093733..02f1f3b396 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanTests.java @@ -175,7 +175,6 @@ void testMandatoryWriter() { /** * Non-skippable (and non-fatal) exception causes failure immediately. - * @throws Exception */ @SuppressWarnings("unchecked") @Test @@ -1039,7 +1038,7 @@ private void assertStepExecutionsAreEqual(StepExecution expected, StepExecution /** * condition: skippable < fatal; exception is unclassified - * + *

        * expected: false; default classification */ @Test @@ -1049,7 +1048,7 @@ void testSkippableSubset_unclassified() throws Exception { /** * condition: skippable < fatal; exception is skippable - * + *

        * expected: true */ @Test @@ -1059,7 +1058,7 @@ void testSkippableSubset_skippable() throws Exception { /** * condition: skippable < fatal; exception is fatal - * + *

        * expected: false */ @Test @@ -1069,7 +1068,7 @@ void testSkippableSubset_fatal() throws Exception { /** * condition: fatal < skippable; exception is unclassified - * + *

        * expected: false; default classification */ @Test @@ -1079,7 +1078,7 @@ void testFatalSubsetUnclassified() throws Exception { /** * condition: fatal < skippable; exception is skippable - * + *

        * expected: true */ @Test @@ -1089,7 +1088,7 @@ void testFatalSubsetSkippable() throws Exception { /** * condition: fatal < skippable; exception is fatal - * + *

        * expected: false */ @Test diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/SimpleStepFactoryBeanTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/SimpleStepFactoryBeanTests.java index 816e35440e..09743e3c69 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/SimpleStepFactoryBeanTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/SimpleStepFactoryBeanTests.java @@ -328,9 +328,8 @@ public void afterChunkError(ChunkContext context) { assertTrue(writeListener.trail.startsWith("1234"), "Listener order not as expected: " + writeListener.trail); } - /** + /* * Commit interval specified is not allowed to be zero or negative. - * @throws Exception */ @Test void testCommitIntervalMustBeGreaterThanZero() throws Exception { @@ -344,9 +343,8 @@ void testCommitIntervalMustBeGreaterThanZero() throws Exception { assertThrows(IllegalStateException.class, factory::getObject); } - /** + /* * Commit interval specified is not allowed to be zero or negative. - * @throws Exception */ @Test void testCommitIntervalAndCompletionPolicyBothSet() { diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/skip/LimitCheckingItemSkipPolicyTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/skip/LimitCheckingItemSkipPolicyTests.java index 74ea51f8f7..3f6164f128 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/skip/LimitCheckingItemSkipPolicyTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/skip/LimitCheckingItemSkipPolicyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,7 +71,7 @@ private LimitCheckingItemSkipPolicy getSkippableSubsetSkipPolicy() { /** * condition: skippable < fatal; exception is unclassified - * + *

        * expected: false; default classification */ @Test @@ -81,7 +81,7 @@ void testSkippableSubset_unclassified() { /** * condition: skippable < fatal; exception is skippable - * + *

        * expected: true */ @Test @@ -91,7 +91,7 @@ void testSkippableSubset_skippable() { /** * condition: skippable < fatal; exception is fatal - * + *

        * expected: false */ @Test @@ -108,7 +108,7 @@ private LimitCheckingItemSkipPolicy getFatalSubsetSkipPolicy() { /** * condition: fatal < skippable; exception is unclassified - * + *

        * expected: false; default classification */ @Test @@ -118,7 +118,7 @@ void testFatalSubset_unclassified() { /** * condition: fatal < skippable; exception is skippable - * + *

        * expected: true */ @Test @@ -128,7 +128,7 @@ void testFatalSubset_skippable() { /** * condition: fatal < skippable; exception is fatal - * + *

        * expected: false */ @Test diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/StepExecutorInterruptionTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/StepExecutorInterruptionTests.java index 2ff333b763..b8bc295ff9 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/StepExecutorInterruptionTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/StepExecutorInterruptionTests.java @@ -227,9 +227,6 @@ public Object read() throws Exception { assertEquals(BatchStatus.FAILED, stepExecution.getStatus()); } - /** - * @return - */ private Thread createThread(final StepExecution stepExecution) { Thread processingThread = new Thread(() -> { try { diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/TaskletStepTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/TaskletStepTests.java index f10516980d..ef6e917b70 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/TaskletStepTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/TaskletStepTests.java @@ -838,10 +838,9 @@ void testStepToCompletion() throws Exception { assertEquals(3, stepExecution.getReadCount()); } - /** + /* * Exception in {@link StepExecutionListener#afterStep(StepExecution)} doesn't cause * step failure. - * @throws JobInterruptedException */ @Test void testStepFailureInAfterStepCallback() throws JobInterruptedException { diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/test/concurrent/ConcurrentTransactionTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/test/concurrent/ConcurrentTransactionTests.java index 5ede7450f0..f8bbf9ebd6 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/test/concurrent/ConcurrentTransactionTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/test/concurrent/ConcurrentTransactionTests.java @@ -173,7 +173,7 @@ public JobRepository jobRepository(DataSource dataSource, PlatformTransactionMan @Configuration static class DataSourceConfiguration { - /** + /* * This datasource configuration configures the HSQLDB instance using MVCC. When * configured using the default behavior, transaction serialization errors are * thrown (default configuration example below). @@ -182,7 +182,6 @@ static class DataSourceConfiguration { * addScript("classpath:org/springframework/batch/core/schema-drop-hsqldb.sql"). * addScript("classpath:org/springframework/batch/core/schema-hsqldb.sql"). * build()); - * @return */ @Bean public DataSource dataSource() { diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/HANAJobRepositoryIntegrationTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/HANAJobRepositoryIntegrationTests.java index 6928d35f30..5b8d8a0a6e 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/HANAJobRepositoryIntegrationTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/HANAJobRepositoryIntegrationTests.java @@ -61,8 +61,8 @@ /** * The official Docker image for SAP HANA is not publicly available. SAP HANA support is - * tested manually. See - * https://hub.docker.com/_/sap-hana-express-edition/plans/f2dc436a-d851-4c22-a2ba-9de07db7a9ac + * tested manually. See ... * FTR, from the previous link: "This installation does not support Docker for Windows or * Docker for Mac." * @@ -196,8 +196,8 @@ protected void configure() { /** * Accepts the license for the SAP HANA Express container by setting the * AGREE_TO_SAP_LICENSE=Y Calling this method will automatically accept the - * license at: - * https://www.sap.com/docs/download/cmp/2016/06/sap-hana-express-dev-agmt-and-exhibit.pdf + * license at: ... * @return The container itself with an environment variable accepting the SAP * HANA Express license */ diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/OracleJobRepositoryIntegrationTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/OracleJobRepositoryIntegrationTests.java index c13067382b..e46fe91d0b 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/OracleJobRepositoryIntegrationTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/OracleJobRepositoryIntegrationTests.java @@ -52,7 +52,8 @@ /** * Official Docker images for Oracle are not publicly available. Oracle support is tested * semi-manually for the moment: 1. Build a docker image for oracle/database:11.2.0.2-xe: - * https://github.com/oracle/docker-images/tree/main/OracleDatabase/SingleInstance#running-oracle-database-11gr2-express-edition-in-a-container + * ... * 2. Run the test `testJobExecution` * * @author Mahmoud Ben Hassine diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/test/step/FaultTolerantStepFactoryBeanIntegrationTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/test/step/FaultTolerantStepFactoryBeanIntegrationTests.java index e991e537fd..99dbc190a5 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/test/step/FaultTolerantStepFactoryBeanIntegrationTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/test/step/FaultTolerantStepFactoryBeanIntegrationTests.java @@ -244,9 +244,6 @@ private static class SkipProcessorStub implements ItemProcessor private final JdbcTemplate jdbcTemplate; - /** - * @param dataSource - */ public SkipProcessorStub(DataSource dataSource) { jdbcTemplate = new JdbcTemplate(dataSource); } diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/test/step/FaultTolerantStepFactoryBeanRollbackIntegrationTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/test/step/FaultTolerantStepFactoryBeanRollbackIntegrationTests.java index 294799de31..6eb416fa06 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/test/step/FaultTolerantStepFactoryBeanRollbackIntegrationTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/test/step/FaultTolerantStepFactoryBeanRollbackIntegrationTests.java @@ -270,9 +270,6 @@ private static class SkipProcessorStub implements ItemProcessor private final JdbcTemplate jdbcTemplate; - /** - * @param dataSource - */ public SkipProcessorStub(DataSource dataSource) { jdbcTemplate = new JdbcTemplate(dataSource); } diff --git a/spring-batch-infrastructure/pom.xml b/spring-batch-infrastructure/pom.xml index 56448ec1c9..432a276385 100644 --- a/spring-batch-infrastructure/pom.xml +++ b/spring-batch-infrastructure/pom.xml @@ -413,6 +413,14 @@ ${angus-mail.version} test + + + + com.google.code.findbugs + jsr305 + ${jsr305.version} + provided + diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ExecutionContext.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ExecutionContext.java index 06b84dd939..49f0d348fb 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ExecutionContext.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ExecutionContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2018 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ * Object representing a context for an {@link ItemStream}. It is a thin wrapper for a map * that allows optionally for type safety on reads. It also allows for dirty checking by * setting a 'dirty' flag whenever any put is called. - * + *

        * Note that putting null value is equivalent to removing the entry for the * given key. * diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ItemProcessor.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ItemProcessor.java index 934a459853..83ec8c45b6 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ItemProcessor.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ItemProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ public interface ItemProcessor { * Process the provided item, returning a potentially modified or new item for * continued processing. If the returned result is {@code null}, it is assumed that * processing of the item should not continue. - * + *

        * A {@code null} item will never reach this method because the only possible sources * are: *

          diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/adapter/AbstractMethodInvokingDelegator.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/adapter/AbstractMethodInvokingDelegator.java index fc96aa5218..a4738b50f8 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/adapter/AbstractMethodInvokingDelegator.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/adapter/AbstractMethodInvokingDelegator.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,7 @@ * Superclass for delegating classes which dynamically call a custom method of injected * object. Provides convenient API for dynamic method invocation shielding subclasses from * low-level details and exception handling. - * + *

          * {@link Exception}s thrown by a successfully invoked delegate method are re-thrown * without wrapping. In case the delegate method throws a {@link Throwable} that doesn't * subclass {@link Exception} it will be wrapped by @@ -197,7 +197,7 @@ public void setTargetMethod(String targetMethod) { * @param arguments arguments values for the { {@link #setTargetMethod(String)}. These * will be used only when the subclass tries to invoke the target method without * providing explicit argument values. - * + *

          * If arguments are set to not-null value {@link #afterPropertiesSet()} will check the * values are compatible with target method's signature. In case arguments are null * (not set) method signature will not be checked and it is assumed correct values diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/adapter/DynamicMethodInvocationException.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/adapter/DynamicMethodInvocationException.java index d87d8bffaa..a02d2cfa0d 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/adapter/DynamicMethodInvocationException.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/adapter/DynamicMethodInvocationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2007 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ /** * Indicates an error has been encountered while trying to dynamically invoke a method * e.g. using {@link MethodInvoker}. - * + *

          * The exception should be caused by a failed invocation of a method, it shouldn't be used * to wrap an exception thrown by successfully invoked method. * diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/avro/AvroItemWriter.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/avro/AvroItemWriter.java index 0d300a9580..99a63b04bf 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/avro/AvroItemWriter.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/avro/AvroItemWriter.java @@ -41,7 +41,7 @@ /** * An {@link ItemWriter} that serializes data to an {@link WritableResource} using Avro. - * + *

          * This does not support restart on failure. * *

          diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/AbstractPaginatedDataItemReader.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/AbstractPaginatedDataItemReader.java index 466d013916..05580de0e5 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/AbstractPaginatedDataItemReader.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/AbstractPaginatedDataItemReader.java @@ -27,7 +27,7 @@ * A base class that handles basic reading logic based on the paginated semantics of * Spring Data's paginated facilities. It also handles the semantics required for * restartability based on those facilities. - * + *

          * This reader is not thread-safe. * * @author Michael Minella diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/Neo4jItemReader.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/Neo4jItemReader.java index e0a0c5fadd..07daeaa9d6 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/Neo4jItemReader.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/Neo4jItemReader.java @@ -59,8 +59,8 @@ * * @author Michael Minella * @author Mahmoud Ben Hassine - * @deprecated since 5.0 in favor of the item reader from - * https://github.com/spring-projects/spring-batch-extensions/blob/main/spring-batch-neo4j + * @deprecated since 5.0 in favor of the item reader from ... */ @Deprecated public class Neo4jItemReader extends AbstractPaginatedDataItemReader implements InitializingBean { diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/Neo4jItemWriter.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/Neo4jItemWriter.java index bc921d86e4..40cfbdb4cc 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/Neo4jItemWriter.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/Neo4jItemWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,8 +40,8 @@ * @author Michael Minella * @author Glenn Renfro * @author Mahmoud Ben Hassine - * @deprecated since 5.0 in favor of the item writer from - * https://github.com/spring-projects/spring-batch-extensions/blob/main/spring-batch-neo4j + * @deprecated since 5.0 in favor of the item writer from ... * */ @Deprecated diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/builder/Neo4jItemReaderBuilder.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/builder/Neo4jItemReaderBuilder.java index eef9778415..1884d2b181 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/builder/Neo4jItemReaderBuilder.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/builder/Neo4jItemReaderBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2021 the original author or authors. + * Copyright 2017-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,8 +30,8 @@ * @author Mahmoud Ben Hassine * @since 4.0 * @see Neo4jItemReader - * @deprecated since 5.0 in favor of the item reader builder from - * https://github.com/spring-projects/spring-batch-extensions/blob/main/spring-batch-neo4j + * @deprecated since 5.0 in favor of the item reader builder from ... */ @Deprecated public class Neo4jItemReaderBuilder { diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/builder/Neo4jItemWriterBuilder.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/builder/Neo4jItemWriterBuilder.java index 3b85bd7f11..1e4e334799 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/builder/Neo4jItemWriterBuilder.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/builder/Neo4jItemWriterBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2021 the original author or authors. + * Copyright 2017-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,8 +29,8 @@ * @author Mahmoud Ben Hassine * @since 4.0 * @see Neo4jItemWriter - * @deprecated since 5.0 in favor of the item writer builder from - * https://github.com/spring-projects/spring-batch-extensions/blob/main/spring-batch-neo4j + * @deprecated since 5.0 in favor of the item writer builder from ... */ @Deprecated public class Neo4jItemWriterBuilder { diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/builder/RepositoryItemWriterBuilder.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/builder/RepositoryItemWriterBuilder.java index 1ef96ca06f..03ad06a884 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/builder/RepositoryItemWriterBuilder.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/builder/RepositoryItemWriterBuilder.java @@ -78,7 +78,7 @@ public RepositoryItemWriterBuilder repository(CrudRepository repository * {@link org.springframework.data.domain.Pageable} as the last argument. * This method can be used in place of {@link #repository(CrudRepository)}, * {@link #methodName(String)}}. - * + *

          * Note: The repository that is used by the repositoryMethodReference must be * non-final. * @param repositoryMethodReference of the used to get a repository and type-safe diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/AbstractCursorItemReader.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/AbstractCursorItemReader.java index 6f747567a4..92e23beb83 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/AbstractCursorItemReader.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/AbstractCursorItemReader.java @@ -345,7 +345,7 @@ public void setDriverSupportsAbsolute(boolean driverSupportsAbsolute) { * set this flag to true then you must wrap the DataSource in a * {@link ExtendedConnectionDataSourceProxy} to prevent the connection from being * closed and released after each commit. - * + *

          * When you set this option to true then the statement used to open the * cursor will be created with both 'READ_ONLY' and 'HOLD_CURSORS_OVER_COMMIT' * options. This allows holding the cursor open over transaction start and commits diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/ExtendedConnectionDataSourceProxy.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/ExtendedConnectionDataSourceProxy.java index 0a0df0b661..9fe20ac921 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/ExtendedConnectionDataSourceProxy.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/ExtendedConnectionDataSourceProxy.java @@ -40,7 +40,7 @@ * Implementation of {@link SmartDataSource} that is capable of keeping a single JDBC * Connection which is NOT closed after each use even if {@link Connection#close()} is * called. - * + *

          * The connection can be kept open over multiple transactions when used together with any * of Spring's {@link org.springframework.transaction.PlatformTransactionManager} * implementations. diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/HibernateCursorItemReader.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/HibernateCursorItemReader.java index 4fdcde65d0..ea1bba0348 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/HibernateCursorItemReader.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/HibernateCursorItemReader.java @@ -39,7 +39,6 @@ * {@link #setQueryName(String)}, or a query provider strategy can be supplied via * {@link #setQueryProvider(HibernateQueryProvider)}. * - * *

          * The reader can be configured to use either {@link StatelessSession} sufficient for * simple mappings without the need to cascade to associated objects or standard hibernate diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/JdbcParameterUtils.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/JdbcParameterUtils.java index de5b59815a..9dff9b026b 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/JdbcParameterUtils.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/JdbcParameterUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ /** * Helper methods for SQL statement parameter parsing. - * + *

          * Only intended for internal use. * * @author Thomas Risberg @@ -38,7 +38,7 @@ public class JdbcParameterUtils { * literal, that is, surrounded by single or double quotes. This method will count * traditional placeholders in the form of a question mark ('?') as well as named * parameters indicated with a leading ':' or '&'. - * + *

          * The code for this method is taken from an early version of the * {@link org.springframework.jdbc.core.namedparam.NamedParameterUtils} class. That * method was later removed after some refactoring, but the code is useful here for diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/JpaCursorItemReader.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/JpaCursorItemReader.java index 4dbae53614..89324c5c57 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/JpaCursorItemReader.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/JpaCursorItemReader.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2022 the original author or authors. + * Copyright 2020-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ * corresponding to the current row. The query can be set directly using * {@link #setQueryString(String)}, or using a query provider via * {@link #setQueryProvider(JpaQueryProvider)}. - * + *

          * The implementation is not thread-safe. * * @author Mahmoud Ben Hassine diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/JpaItemWriter.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/JpaItemWriter.java index d6ff2ebcf6..a3e531c3a3 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/JpaItemWriter.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/JpaItemWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,12 +32,12 @@ /** * {@link org.springframework.batch.item.ItemWriter} that is using a JPA * EntityManagerFactory to merge any Entities that aren't part of the persistence context. - * + *

          * It is required that {@link #write(Chunk)} is called inside a transaction.
          * * The reader must be configured with an {@link jakarta.persistence.EntityManagerFactory} * that is capable of participating in Spring managed transactions. - * + *

          * The writer is thread-safe after its properties are set (normal singleton behaviour), so * it can be used to write in multiple concurrent transactions. * diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/builder/JdbcBatchItemWriterBuilder.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/builder/JdbcBatchItemWriterBuilder.java index 69fd69ae33..ab74683bc3 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/builder/JdbcBatchItemWriterBuilder.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/builder/JdbcBatchItemWriterBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -132,7 +132,7 @@ public JdbcBatchItemWriterBuilder namedParametersJdbcTemplate( /** * Creates a {@link ColumnMapItemPreparedStatementSetter} to be used as your * {@link ItemPreparedStatementSetter}. - * + *

          * NOTE: The item type for this {@link org.springframework.batch.item.ItemWriter} must * be castable to Map<String,Object>>. * @return The current instance of the builder for chaining diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/AbstractSqlPagingQueryProvider.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/AbstractSqlPagingQueryProvider.java index 439b105437..af9a17b393 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/AbstractSqlPagingQueryProvider.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/AbstractSqlPagingQueryProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,13 +32,13 @@ /** * Abstract SQL Paging Query Provider to serve as a base class for all provided SQL paging * query providers. - * + *

          * Any implementation must provide a way to specify the select clause, from clause and * optionally a where clause. In addition a way to specify a single column sort key must * also be provided. This sort key will be used to provide the paging functionality. It is * recommended that there should be an index for the sort key to provide better * performance. - * + *

          * Provides properties and preparation for the mandatory "selectClause" and "fromClause" * as well as for the optional "whereClause". Also provides property for the mandatory * "sortKeys". Note: The columns that make up the sort key must be a true key and diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/DefaultDataFieldMaxValueIncrementerFactory.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/DefaultDataFieldMaxValueIncrementerFactory.java index ba0c28eddb..ef9c279cf8 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/DefaultDataFieldMaxValueIncrementerFactory.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/DefaultDataFieldMaxValueIncrementerFactory.java @@ -52,7 +52,7 @@ /** * Default implementation of the {@link DataFieldMaxValueIncrementerFactory} interface. * Valid database types are given by the {@link DatabaseType} enum. - * + *

          * Note: For MySql databases, the * {@link MySQLMaxValueIncrementer#setUseNewConnection(boolean)} will be set to true. * diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/DerbyPagingQueryProvider.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/DerbyPagingQueryProvider.java index ac64221913..b2f4ab422c 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/DerbyPagingQueryProvider.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/DerbyPagingQueryProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2021 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ /** * Derby implementation of a {@link PagingQueryProvider} using standard SQL:2003 windowing * functions. These features are supported starting with Apache Derby version 10.4.1.3. - * + *

          * As the OVER() function does not support the ORDER BY clause a sub query is instead used * to order the results before the ROW_NUM restriction is applied * diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/PostgresPagingQueryProvider.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/PostgresPagingQueryProvider.java index c9d050017e..4b65d2e3d9 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/PostgresPagingQueryProvider.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/PostgresPagingQueryProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ * Postgres implementation of a * {@link org.springframework.batch.item.database.PagingQueryProvider} using database * specific features. - * + *

          * When using the groupClause, this implementation expects all select fields not used in * aggregate functions to be included in the groupClause (the provider does not add them * for you). diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/SqlWindowingPagingQueryProvider.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/SqlWindowingPagingQueryProvider.java index dd2dd14a1b..1f75726aaf 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/SqlWindowingPagingQueryProvider.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/SqlWindowingPagingQueryProvider.java @@ -118,7 +118,7 @@ protected String getOverSubstituteClauseEnd() { /** * Generates ORDER BY attributes based on the sort keys. - * @param provider + * @param provider the paging query provider * @return a String that can be appended to an ORDER BY clause. */ private String buildSortClause(AbstractSqlPagingQueryProvider provider) { diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/MultiResourceItemReader.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/MultiResourceItemReader.java index c985498c8f..341f4222eb 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/MultiResourceItemReader.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/MultiResourceItemReader.java @@ -37,7 +37,7 @@ * Reads items from multiple resources sequentially - resource list is given by * {@link #setResources(Resource[])}, the actual reading is delegated to * {@link #setDelegate(ResourceAwareItemReaderItemStream)}. - * + *

          * Input resources are ordered using {@link #setComparator(Comparator)} to make sure * resource ordering is preserved between job runs in restart scenario. * diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/MultiResourceItemWriter.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/MultiResourceItemWriter.java index fb1ac8c9e6..1480cba407 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/MultiResourceItemWriter.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/MultiResourceItemWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ * when the count of items written in current resource exceeds * {@link #setItemCountLimitPerResource(int)}. Suffix creation can be customized with * {@link #setResourceSuffixCreator(ResourceSuffixCreator)}. - * + *

          * Note that new resources are created only at chunk boundaries i.e. the number of items * written into one resource is between the limit set by * {@link #setItemCountLimitPerResource(int)} and (limit + chunk size). diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/SimpleBinaryBufferedReaderFactory.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/SimpleBinaryBufferedReaderFactory.java index 0314896ff6..098ff06eb5 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/SimpleBinaryBufferedReaderFactory.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/SimpleBinaryBufferedReaderFactory.java @@ -66,9 +66,6 @@ private static final class BinaryBufferedReader extends BufferedReader { private final String ending; - /** - * @param in - */ private BinaryBufferedReader(Reader in, String ending) { super(in); this.ending = ending; diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/mapping/BeanWrapperFieldSetMapper.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/mapping/BeanWrapperFieldSetMapper.java index 665cf4ec77..0a4ecdaef3 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/mapping/BeanWrapperFieldSetMapper.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/mapping/BeanWrapperFieldSetMapper.java @@ -134,7 +134,7 @@ public void setDistanceLimit(int distanceLimit) { * The bean name (id) for an object that can be populated from the field set that will * be passed into {@link #mapFieldSet(FieldSet)}. Typically a prototype scoped bean so * that a new instance is returned for each field set mapped. - * + *

          * Either this property or the type property must be specified, but not both. * @param name the name of a prototype bean in the enclosing BeanFactory */ diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/separator/DefaultRecordSeparatorPolicy.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/separator/DefaultRecordSeparatorPolicy.java index fb86c78c10..16e86efc1a 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/separator/DefaultRecordSeparatorPolicy.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/separator/DefaultRecordSeparatorPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2007 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -109,8 +109,8 @@ public String preProcess(String line) { /** * Determine if the current line (or buffered concatenation of lines) contains an * unterminated quote, indicating that the record is continuing onto the next line. - * @param line - * @return + * @param line the line to check + * @return true if the quote is unterminated, false otherwise */ private boolean isQuoteUnterminated(String line) { return StringUtils.countOccurrencesOf(line, quoteCharacter) % 2 != 0; @@ -119,8 +119,8 @@ private boolean isQuoteUnterminated(String line) { /** * Determine if the current line (or buffered concatenation of lines) ends with the * continuation marker, indicating that the record is continuing onto the next line. - * @param line - * @return + * @param line the line to check + * @return true if the line ends with the continuation marker, false otherwise */ private boolean isContinued(String line) { if (line == null) { diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/DefaultFieldSet.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/DefaultFieldSet.java index df75d60a21..c0e833831c 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/DefaultFieldSet.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/DefaultFieldSet.java @@ -28,6 +28,7 @@ import java.util.Locale; import java.util.Properties; +import org.springframework.lang.Nullable; import org.springframework.util.Assert; import org.springframework.util.StringUtils; @@ -627,6 +628,7 @@ public int getFieldCount() { * @param index the offset in the token array to obtain the value to be trimmed. * @return null if the field value is null. */ + @Nullable protected String readAndTrim(int index) { String value = tokens[index]; diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/mail/builder/SimpleMailMessageItemWriterBuilder.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/mail/builder/SimpleMailMessageItemWriterBuilder.java index 25b96b3847..247f0d1c3a 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/mail/builder/SimpleMailMessageItemWriterBuilder.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/mail/builder/SimpleMailMessageItemWriterBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2022 the original author or authors. + * Copyright 2017-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ package org.springframework.batch.item.mail.builder; +import org.springframework.batch.item.Chunk; import org.springframework.batch.item.mail.DefaultMailErrorHandler; import org.springframework.batch.item.mail.MailErrorHandler; import org.springframework.batch.item.mail.SimpleMailMessageItemWriter; diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/AbstractItemCountingItemStreamItemReader.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/AbstractItemCountingItemStreamItemReader.java index 23034eb7c4..ff008e5e4a 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/AbstractItemCountingItemStreamItemReader.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/AbstractItemCountingItemStreamItemReader.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2019 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,7 @@ * Abstract superclass for {@link ItemReader}s that supports restart by storing item count * in the {@link ExecutionContext} (therefore requires item ordering to be preserved * between runs). - * + *

          * Subclasses are inherently not thread-safe. * * @author Robert Kasanicky diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/AbstractItemStreamItemReader.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/AbstractItemStreamItemReader.java index b0db566bc6..90ce517d0e 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/AbstractItemStreamItemReader.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/AbstractItemStreamItemReader.java @@ -22,7 +22,7 @@ /** * Base class for {@link ItemReader} implementations. - * + *

          * This abstract reader is thread-safe. * * @author Dave Syer diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/AbstractItemStreamItemWriter.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/AbstractItemStreamItemWriter.java index e513b0d74d..104f6686b7 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/AbstractItemStreamItemWriter.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/AbstractItemStreamItemWriter.java @@ -22,7 +22,7 @@ /** * Base class for {@link ItemWriter} implementations. - * + *

          * This abstract writer is thread-safe. * * @author Dave Syer diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/ClassifierCompositeItemProcessor.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/ClassifierCompositeItemProcessor.java index c06e911f22..da0d1d4736 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/ClassifierCompositeItemProcessor.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/ClassifierCompositeItemProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2019 the original author or authors. + * Copyright 2014-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ /** * Calls one of a collection of ItemProcessors, based on a router pattern implemented * through the provided {@link Classifier}. - * + *

          * Note the user is responsible for injecting a {@link Classifier} that returns an * ItemProcessor that conforms to the declared input and output types. * diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/ClassifierCompositeItemWriter.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/ClassifierCompositeItemWriter.java index abb8c01b93..7b82bab5e7 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/ClassifierCompositeItemWriter.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/ClassifierCompositeItemWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ /** * Calls one of a collection of ItemWriters for each item, based on a router pattern * implemented through the provided {@link Classifier}. - * + *

          * The implementation is thread-safe if all delegates are thread-safe. * * @author Dave Syer diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/ScriptItemProcessor.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/ScriptItemProcessor.java index 79a0840c5a..44e563beed 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/ScriptItemProcessor.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/ScriptItemProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ */ public class ScriptItemProcessor implements ItemProcessor, InitializingBean { - private static final String ITEM_BINDING_VARIABLE_NAME = "item"; + public static final String ITEM_BINDING_VARIABLE_NAME = "item"; private String language; diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/SynchronizedItemStreamReader.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/SynchronizedItemStreamReader.java index 5b79c401e2..61de9f70bb 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/SynchronizedItemStreamReader.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/SynchronizedItemStreamReader.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2022 the original author or authors. + * Copyright 2015-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,13 +28,11 @@ * * This is a simple ItemStreamReader decorator with a synchronized ItemReader.read() * method - which makes a non-thread-safe ItemReader thread-safe. - * + *

          * However, if reprocessing an item is problematic then using this will make a job not * restartable. - * - * Here are some links about the motivation behind this class: - - * https://projects.spring.io/spring-batch/faq.html#threading-reader} - - * https://stackoverflow.com/a/20002493/2910265} + *

          + * Here is the motivation behind this class: https://stackoverflow.com/a/20002493/2910265 * * @author Matthew Ouyang * @since 3.0.4 diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/SynchronizedItemStreamWriter.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/SynchronizedItemStreamWriter.java index f26245c728..56fc6710bc 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/SynchronizedItemStreamWriter.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/SynchronizedItemStreamWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2022 the original author or authors. + * Copyright 2020-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ /** * An {@link ItemStreamWriter} decorator with a synchronized * {@link SynchronizedItemStreamWriter#write write()} method. - * + *

          * This decorator is useful when using a non thread-safe item writer in a multi-threaded * step. Typical delegate examples are the * {@link org.springframework.batch.item.json.JsonFileItemWriter JsonFileItemWriter} and diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/StaxEventItemReader.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/StaxEventItemReader.java index 827c1fa2e6..2a70c39d48 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/StaxEventItemReader.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/StaxEventItemReader.java @@ -50,11 +50,11 @@ /** * Item reader for reading XML input based on StAX. - * + *

          * It extracts fragments from the input XML document which correspond to records for * processing. The fragments are wrapped with StartDocument and EndDocument events so that * the fragments can be further processed like standalone XML documents. - * + *

          * The implementation is not thread-safe. * * @author Robert Kasanicky @@ -170,7 +170,7 @@ public void afterPropertiesSet() throws Exception { /** * Responsible for moving the cursor before the StartElement of the fragment root. - * + *

          * This implementation simply looks for the next corresponding element, it does not * care about element nesting. You will need to override this method to correctly * handle composite fragments. diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/StaxEventItemWriter.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/StaxEventItemWriter.java index d6c9af1e5b..86df8cf352 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/StaxEventItemWriter.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/StaxEventItemWriter.java @@ -64,10 +64,10 @@ /** * An implementation of {@link ItemWriter} which uses StAX and {@link Marshaller} for * serializing object to XML. - * + *

          * This item writer also provides restart, statistics and transaction features by * implementing corresponding interfaces. - * + *

          * The implementation is not thread-safe. * * @author Peter Zozom diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/context/SynchronizedAttributeAccessor.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/context/SynchronizedAttributeAccessor.java index bef84e66d2..51f1bd1a51 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/context/SynchronizedAttributeAccessor.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/context/SynchronizedAttributeAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2007 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ import org.springframework.core.AttributeAccessor; import org.springframework.core.AttributeAccessorSupport; +import org.springframework.lang.Nullable; /** * An {@link AttributeAccessor} that synchronizes on a mutex (not this) before modifying @@ -141,6 +142,7 @@ public void setAttribute(String name, Object value) { * @param value the value of the attribute * @return null if the attribute was not already set, the existing value otherwise. */ + @Nullable public Object setAttributeIfAbsent(String name, Object value) { synchronized (support) { Object old = getAttribute(name); diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/interceptor/RepeatOperationsInterceptor.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/interceptor/RepeatOperationsInterceptor.java index 422370fb9f..805e7555c4 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/interceptor/RepeatOperationsInterceptor.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/interceptor/RepeatOperationsInterceptor.java @@ -121,10 +121,6 @@ public Object invoke(final MethodInvocation invocation) throws Throwable { + ". The invocation was never called, so maybe there is a problem with the completion policy?"); } - /** - * @param result - * @return - */ private boolean isComplete(Object result) { return result == null || (result instanceof Boolean) && !(Boolean) result; } @@ -139,10 +135,6 @@ private boolean isComplete(Object result) { @SuppressWarnings("serial") private static class RepeatOperationsInterceptorException extends RepeatException { - /** - * @param message - * @param e - */ public RepeatOperationsInterceptorException(String message, Throwable e) { super(message, e); } @@ -170,9 +162,6 @@ public void setValue(Object value) { this.value = value; } - /** - * @param value - */ public void setFinalValue(Object value) { if (ready) { // Only set the value the last time if the last time was also diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ResultHolder.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ResultHolder.java index 44215fc1be..86764f3f47 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ResultHolder.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ResultHolder.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,6 @@ interface ResultHolder { * Get the result for client from this holder. Does not block if none is available * yet. * @return the result, or null if there is none. - * @throws IllegalStateException */ RepeatStatus getResult(); @@ -41,7 +40,6 @@ interface ResultHolder { * Get the error for client from this holder if any. Does not block if none is * available yet. * @return the error, or null if there is none. - * @throws IllegalStateException */ Throwable getError(); diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/MethodInvokerUtils.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/MethodInvokerUtils.java index febfe44e2b..dc45b17e59 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/MethodInvokerUtils.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/MethodInvokerUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ import org.springframework.aop.framework.Advised; import org.springframework.core.annotation.AnnotationUtils; +import org.springframework.lang.Nullable; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; import org.springframework.util.ObjectUtils; @@ -43,7 +44,7 @@ public class MethodInvokerUtils { * @param paramsRequired boolean indicating whether the parameters are required, if * false, a no args version of the method will be searched for. * @param paramTypes - parameter types of the method to search for. - * @return MethodInvoker if the method is found, null if it is not. + * @return MethodInvoker if the method is found */ public static MethodInvoker getMethodInvokerByName(Object object, String methodName, boolean paramsRequired, Class... paramTypes) { @@ -87,6 +88,7 @@ public static String getParamTypesString(Class... paramTypes) { * @param paramTypes - parameter types of the method to search for. * @return MethodInvoker if the method is found, null if it is not. */ + @Nullable public static MethodInvoker getMethodInvokerForInterface(Class cls, String methodName, Object object, Class... paramTypes) { @@ -141,6 +143,7 @@ public static MethodInvoker getMethodInvokerByAnnotation(final Class annotationType, final Object target) { Assert.notNull(target, "Target must not be null"); diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/transaction/TransactionAwareBufferedWriter.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/transaction/TransactionAwareBufferedWriter.java index 390fd98e87..c67c4e4f01 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/transaction/TransactionAwareBufferedWriter.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/transaction/TransactionAwareBufferedWriter.java @@ -85,7 +85,7 @@ public void setForceSync(boolean forceSync) { } /** - * @return + * @return the current buffer */ private StringBuilder getCurrentBuffer() { @@ -166,7 +166,7 @@ public long getBufferSize() { } /** - * @return + * @return true if the actual transaction is active, false otherwise */ private boolean transactionActive() { return TransactionSynchronizationManager.isActualTransactionActive(); diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/avro/example/AvroTestUtils.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/avro/example/AvroTestUtils.java index 86e4599c78..63182ec246 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/avro/example/AvroTestUtils.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/avro/example/AvroTestUtils.java @@ -28,7 +28,8 @@ import org.springframework.core.io.Resource; /** - * Used to create test data. See http://avro.apache.org/docs/1.9.0/gettingstartedjava.html + * Used to create test data. See + * ... * * @author David Turanski * @author Mahmoud Ben Hassine diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/avro/example/User.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/avro/example/User.java index 166fcd0f92..0416ff9ec8 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/avro/example/User.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/avro/example/User.java @@ -14,7 +14,7 @@ * limitations under the License. */ -/** +/* * Autogenerated by Avro * * DO NOT EDIT DIRECTLY diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/HibernateCursorItemReaderIntegrationTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/HibernateCursorItemReaderIntegrationTests.java index db84f185a1..3bd5ed7a6d 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/HibernateCursorItemReaderIntegrationTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/HibernateCursorItemReaderIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2022 the original author or authors. + * Copyright 2008-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ class HibernateCursorItemReaderIntegrationTests extends AbstractHibernateCursorI /** * Exception scenario. - * + *

          * {@link HibernateCursorItemReader#setUseStatelessSession(boolean)} can be called * only in uninitialized state. */ diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JdbcPagingItemReaderAsyncTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JdbcPagingItemReaderAsyncTests.java index 26aeb65920..55206574b6 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JdbcPagingItemReaderAsyncTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JdbcPagingItemReaderAsyncTests.java @@ -105,11 +105,6 @@ void testAsyncReader() { } } - /** - * @throws Exception - * @throws InterruptedException - * @throws ExecutionException - */ private void doTest() throws Exception, InterruptedException, ExecutionException { final ItemReader reader = getItemReader(); CompletionService> completionService = new ExecutorCompletionService<>( diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderAsyncTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderAsyncTests.java index fd91b44cdf..b2b36bf256 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderAsyncTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderAsyncTests.java @@ -99,11 +99,6 @@ void testAsyncReader() { } } - /** - * @throws Exception - * @throws InterruptedException - * @throws ExecutionException - */ private void doTest() throws Exception, InterruptedException, ExecutionException { final JpaPagingItemReader reader = getItemReader(); CompletionService> completionService = new ExecutorCompletionService<>( diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/file/FlatFileItemWriterTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/file/FlatFileItemWriterTests.java index 361b6b2c90..f8f4df0ccb 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/file/FlatFileItemWriterTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/file/FlatFileItemWriterTests.java @@ -212,7 +212,6 @@ void testOpenTwice() { /** * Regular usage of write(String) method - * @throws Exception */ @Test void testWriteString() throws Exception { @@ -237,7 +236,6 @@ void testForcedWriteString() throws Exception { /** * Regular usage of write(String) method - * @throws Exception */ @Test void testWriteWithConverter() throws Exception { @@ -252,7 +250,6 @@ void testWriteWithConverter() throws Exception { /** * Regular usage of write(String) method - * @throws Exception */ @Test void testWriteWithConverterAndString() throws Exception { @@ -265,7 +262,6 @@ void testWriteWithConverterAndString() throws Exception { /** * Regular usage of write(String[], LineDescriptor) method - * @throws Exception */ @Test void testWriteRecord() throws Exception { diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Customer.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Customer.java index bd0136ddc6..814c40968d 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Customer.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Customer.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2007 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ /** * An XML customer. - * + *

          * This is a complex type. */ public class Customer { diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/LineItem.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/LineItem.java index fcd0d743ad..9df21958c6 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/LineItem.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/LineItem.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2007 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ /** * An XML line-item. - * + *

          * This is a complex type. */ public class LineItem { diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Order.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Order.java index 6fa2fc68cc..07ce6b7447 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Order.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Order.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2007 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ /** * An XML order. - * + *

          * This is a complex type. */ public class Order { diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Shipper.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Shipper.java index 5685d5e780..9d973d4bb9 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Shipper.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Shipper.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2007 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ /** * An XML shipper. - * + *

          * This is a complex type. */ public class Shipper { diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/support/AbstractSynchronizedItemStreamWriterTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/support/AbstractSynchronizedItemStreamWriterTests.java index 79eae3687f..1df1465851 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/support/AbstractSynchronizedItemStreamWriterTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/support/AbstractSynchronizedItemStreamWriterTests.java @@ -28,8 +28,7 @@ import static org.mockito.Mockito.verify; /** - * Common parent class for {@link SynchronizedItemStreamWriterTests} and - * {@link org.springframework.batch.item.support.builder.SynchronizedItemStreamWriterBuilderTests} + * Common parent class for {@link SynchronizedItemStreamWriter} related tests. * * @author Dimitrios Liapis * @author Mahmoud Ben Hassine diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/StaxEventItemReaderTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/StaxEventItemReaderTests.java index 570e880a9b..7b08eb6b02 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/StaxEventItemReaderTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/StaxEventItemReaderTests.java @@ -715,7 +715,7 @@ public boolean supports(Class clazz) { /** * A simple mapFragment implementation checking the StaxEventReaderItemReader * basic read functionality. - * @param source + * @param source to unmarshal * @return list of the events from fragment body */ @Override diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/exception/SimpleLimitExceptionHandlerTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/exception/SimpleLimitExceptionHandlerTests.java index 353e37c9b4..e064c604c5 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/exception/SimpleLimitExceptionHandlerTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/exception/SimpleLimitExceptionHandlerTests.java @@ -64,10 +64,9 @@ void testDefaultBehaviour() { assertSame(expected, throwable); } - /** + /* * Other than nominated exception type should be rethrown, ignoring the exception * limit. - * @throws Exception */ @Test void testNormalExceptionThrown() throws Throwable { @@ -83,9 +82,8 @@ void testNormalExceptionThrown() throws Throwable { assertSame(expected, throwable); } - /** + /* * TransactionInvalidException should only be rethrown below the exception limit. - * @throws Exception */ @Test void testLimitedExceptionTypeNotThrown() throws Throwable { @@ -97,9 +95,8 @@ void testLimitedExceptionTypeNotThrown() throws Throwable { assertDoesNotThrow(() -> handler.handleException(new RepeatContextSupport(null), new RuntimeException("foo"))); } - /** + /* * TransactionInvalidException should only be rethrown below the exception limit. - * @throws Exception */ @Test void testLimitedExceptionNotThrownFromSiblings() throws Throwable { @@ -120,9 +117,8 @@ void testLimitedExceptionNotThrownFromSiblings() throws Throwable { }); } - /** + /* * TransactionInvalidException should only be rethrown below the exception limit. - * @throws Exception */ @Test void testLimitedExceptionThrownFromSiblingsWhenUsingParent() throws Throwable { diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/ItemReaderRepeatCallback.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/ItemReaderRepeatCallback.java index b5a1fc791e..2fc2035b8a 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/ItemReaderRepeatCallback.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/ItemReaderRepeatCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,10 +33,6 @@ public class ItemReaderRepeatCallback implements RepeatCallback { private final ItemWriter writer; - /** - * @param reader - * @param writer - */ public ItemReaderRepeatCallback(ItemReader reader, ItemWriter writer) { this.writer = writer; this.reader = reader; diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplateBulkAsynchronousTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplateBulkAsynchronousTests.java index b8cf576b1d..cb39231a65 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplateBulkAsynchronousTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplateBulkAsynchronousTests.java @@ -244,7 +244,7 @@ public RepeatStatus doInIteration(RepeatContext context) throws Exception { * sufficiently long for another worker to be launched while it is busy, the early * completion tests will fail. "Sufficiently long" is the problem so we try and block * until we know someone else is busy? - * @throws Exception + * @throws Exception if interrupted while being busy */ private void beBusy() throws Exception { synchronized (this) { diff --git a/spring-batch-integration/pom.xml b/spring-batch-integration/pom.xml index 27ef882e1b..bd69db83b1 100644 --- a/spring-batch-integration/pom.xml +++ b/spring-batch-integration/pom.xml @@ -158,5 +158,13 @@ ${aspectj.version} test + + + + com.google.code.findbugs + jsr305 + ${jsr305.version} + provided + diff --git a/spring-batch-integration/src/main/java/org/springframework/batch/integration/async/AsyncItemProcessor.java b/spring-batch-integration/src/main/java/org/springframework/batch/integration/async/AsyncItemProcessor.java index 9b65d9e2a2..1c30ab3b9d 100644 --- a/spring-batch-integration/src/main/java/org/springframework/batch/integration/async/AsyncItemProcessor.java +++ b/spring-batch-integration/src/main/java/org/springframework/batch/integration/async/AsyncItemProcessor.java @@ -33,11 +33,12 @@ * An {@link ItemProcessor} that delegates to a nested processor and in the background. To * allow for background processing the return value from the processor is a {@link Future} * which needs to be unpacked before the item can be used by a client. - * + *

          * Because the {@link Future} is typically unwrapped in the {@link ItemWriter}, there are * lifecycle and stats limitations (since the framework doesn't know what the result of * the processor is). While not an exhaustive list, things like - * {@link StepExecution#filterCount} will not reflect the number of filtered items and + * {@link StepExecution#getFilterCount()} will not reflect the number of filtered items + * and * {@link org.springframework.batch.core.ItemProcessListener#onProcessError(Object, Exception)} * will not be called. * diff --git a/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/RemoteChunkingManagerStepBuilder.java b/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/RemoteChunkingManagerStepBuilder.java index daf2fd19d2..6d2f8ef25d 100644 --- a/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/RemoteChunkingManagerStepBuilder.java +++ b/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/RemoteChunkingManagerStepBuilder.java @@ -363,7 +363,7 @@ public RemoteChunkingManagerStepBuilder chunk(CompletionPolicy completionP * This method will throw a {@link UnsupportedOperationException} since the item * writer of the manager step in a remote chunking setup will be automatically set to * an instance of {@link ChunkMessageChannelItemWriter}. - * + *

          * When building a manager step for remote chunking, no item writer must be provided. * @throws UnsupportedOperationException if an item writer is provided * @see ChunkMessageChannelItemWriter diff --git a/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/MessageChannelPartitionHandler.java b/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/MessageChannelPartitionHandler.java index 20be4c3972..9b16964100 100644 --- a/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/MessageChannelPartitionHandler.java +++ b/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/MessageChannelPartitionHandler.java @@ -64,7 +64,7 @@ * pick up missing messages and processing. The remote workers need access to the Spring * Batch {@link JobRepository} so that the shared state across those restarts can be * managed centrally. - * + *

          * While a {@link org.springframework.messaging.MessageChannel} is used for sending the * requests to the workers, the worker's responses can be obtained in one of two ways: *

            diff --git a/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/RemotePartitioningManagerStepBuilder.java b/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/RemotePartitioningManagerStepBuilder.java index 60178e3da0..089f3eee80 100644 --- a/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/RemotePartitioningManagerStepBuilder.java +++ b/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/RemotePartitioningManagerStepBuilder.java @@ -306,7 +306,7 @@ public RemotePartitioningManagerStepBuilder allowStartIfComplete(boolean allowSt * This method will throw a {@link UnsupportedOperationException} since the partition * handler of the manager step will be automatically set to an instance of * {@link MessageChannelPartitionHandler}. - * + *

            * When building a manager step for remote partitioning using this builder, no * partition handler must be provided. * @param partitionHandler a partition handler diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/StepSupport.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/StepSupport.java index fdfce19c0b..0a5479d610 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/StepSupport.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/StepSupport.java @@ -31,7 +31,7 @@ public class StepSupport implements Step { private int startLimit = 1; /** - * @param name + * @param name the step name */ public StepSupport(String name) { super(); diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/common/StagingItemReader.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/common/StagingItemReader.java index 55d9254132..3472f00d26 100644 --- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/common/StagingItemReader.java +++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/common/StagingItemReader.java @@ -40,7 +40,7 @@ /** * Thread-safe database {@link ItemReader} implementing the process indicator pattern. - * + *

            * To achieve restartability use together with {@link StagingItemProcessor}. */ public class StagingItemReader diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/common/StagingItemWriter.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/common/StagingItemWriter.java index db613c6a81..534f60a1c9 100644 --- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/common/StagingItemWriter.java +++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/common/StagingItemWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,7 +69,7 @@ public void setIncrementer(DataFieldMaxValueIncrementer incrementer) { /** * Serialize the item to the staging table, and add a NEW processed flag. * - * @see ItemWriter#write(java.util.List) + * @see ItemWriter#write(Chunk) */ @Override public void write(final Chunk chunk) { diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/order/internal/xml/Customer.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/order/internal/xml/Customer.java index 69b08bf6f5..709dd10833 100644 --- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/order/internal/xml/Customer.java +++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/order/internal/xml/Customer.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2007 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ /** * An XML customer. - * + *

            * This is a complex type. */ public class Customer { diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/order/internal/xml/LineItem.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/order/internal/xml/LineItem.java index 83f0fd56cd..bdc71dc2e6 100644 --- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/order/internal/xml/LineItem.java +++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/order/internal/xml/LineItem.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2007 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ /** * An XML line-item. - * + *

            * This is a complex type. */ public class LineItem { diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/order/internal/xml/Order.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/order/internal/xml/Order.java index cd51369d1c..081849dada 100644 --- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/order/internal/xml/Order.java +++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/order/internal/xml/Order.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2014 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ /** * An XML order. - * + *

            * This is a complex type. */ public class Order { diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/order/internal/xml/Shipper.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/order/internal/xml/Shipper.java index 9fe8905f56..40a844dbe2 100644 --- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/order/internal/xml/Shipper.java +++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/domain/order/internal/xml/Shipper.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2007 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ /** * An XML shipper. - * + *

            * This is a complex type. */ public class Shipper { diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/mongodb/MongoDBSampleApp.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/mongodb/MongoDBSampleApp.java index 73e2ff69c2..bb651fdcfd 100644 --- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/mongodb/MongoDBSampleApp.java +++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/mongodb/MongoDBSampleApp.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 the original author or authors. + * Copyright 2020-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ /** * Ensure a MongoDB instance is running on "localhost:27017", otherwise modify * mongodb-sample.properties file as needed. - * + *

            * If you use docker, you can run a mongo db server with: "docker run --name mongodb --rm * -d -p 27017:27017 mongo" * diff --git a/spring-batch-samples/src/test/java/org/springframework/batch/sample/RestartFunctionalTests.java b/spring-batch-samples/src/test/java/org/springframework/batch/sample/RestartFunctionalTests.java index 5c5b074c0d..52e67c68e0 100644 --- a/spring-batch-samples/src/test/java/org/springframework/batch/sample/RestartFunctionalTests.java +++ b/spring-batch-samples/src/test/java/org/springframework/batch/sample/RestartFunctionalTests.java @@ -61,12 +61,11 @@ void onTearDown() { JdbcTestUtils.deleteFromTables(jdbcTemplate, "TRADE"); } - /** + /* * Job fails on first run, because the module throws exception after processing more * than half of the input. On the second run, the job should finish successfully, * because it continues execution where the previous run stopped (module throws * exception after fixed number of processed records). - * @throws Exception */ @Test void testLaunchJob() throws Exception { diff --git a/spring-batch-samples/src/test/java/org/springframework/batch/sample/common/ErrorLogTasklet.java b/spring-batch-samples/src/test/java/org/springframework/batch/sample/common/ErrorLogTasklet.java index 98a698c3e8..255e66dc4b 100644 --- a/spring-batch-samples/src/test/java/org/springframework/batch/sample/common/ErrorLogTasklet.java +++ b/spring-batch-samples/src/test/java/org/springframework/batch/sample/common/ErrorLogTasklet.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2021 the original author or authors. + * Copyright 2008-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,7 @@ public RepeatStatus execute(StepContribution contribution, ChunkContext chunkCon } /** - * @return + * @return the skip count */ private long getSkipCount() { if (stepExecution == null || stepName == null) { diff --git a/spring-batch-test/pom.xml b/spring-batch-test/pom.xml index 69f37e86d8..31df071856 100644 --- a/spring-batch-test/pom.xml +++ b/spring-batch-test/pom.xml @@ -112,5 +112,13 @@ + + + + com.google.code.findbugs + jsr305 + ${jsr305.version} + provided + diff --git a/spring-batch-test/src/main/java/org/springframework/batch/test/StepRunner.java b/spring-batch-test/src/main/java/org/springframework/batch/test/StepRunner.java index 57cc6bc6b7..d60a129f38 100755 --- a/spring-batch-test/src/main/java/org/springframework/batch/test/StepRunner.java +++ b/spring-batch-test/src/main/java/org/springframework/batch/test/StepRunner.java @@ -159,8 +159,8 @@ public void beforeJob(JobExecution jobExecution) { /** * Launch the given job - * @param job - * @param jobParameters + * @param job to launch + * @param jobParameters the job parameters */ private JobExecution launchJob(Job job, JobParameters jobParameters) { try {