Skip to content

Commit d424f5a

Browse files
committed
Execute OpenRewrite recipes
This executed: ``` mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:RELEASE -Drewrite.activeRecipes=org.openrewrite.java.jspecify.MigrateFromSpringFrameworkAnnotations,org.openrewrite.staticanalysis.AnnotateNullableMethods,org.openrewrite.staticanalysis.NullableOnMethodReturnType -Drewrite.exportDatatables=true ``` Signed-off-by: Stefano Cordio <stefano.cordio@gmail.com>
1 parent 3bdcb53 commit d424f5a

File tree

289 files changed

+960
-926
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

289 files changed

+960
-926
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/SpringBatchVersion.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package org.springframework.batch.core;
1717

18-
import org.springframework.lang.Nullable;
18+
import org.jspecify.annotations.Nullable;
1919

2020
/**
2121
* Class that exposes the Spring Batch version. Fetches the "Implementation-Version"
@@ -43,8 +43,7 @@ private SpringBatchVersion() {
4343
* {@code "N/A"} if it cannot be determined.
4444
* @see Package#getImplementationVersion()
4545
*/
46-
@Nullable
47-
public static String getVersion() {
46+
public static @Nullable String getVersion() {
4847
Package pkg = SpringBatchVersion.class.getPackage();
4948
if (pkg != null && pkg.getImplementationVersion() != null) {
5049
return pkg.getImplementationVersion();

spring-batch-core/src/main/java/org/springframework/batch/core/configuration/JobLocator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
*/
1616
package org.springframework.batch.core.configuration;
1717

18+
import org.jspecify.annotations.Nullable;
19+
1820
import org.springframework.batch.core.job.Job;
1921
import org.springframework.batch.core.launch.NoSuchJobException;
20-
import org.springframework.lang.Nullable;
2122

2223
/**
2324
* A runtime service locator interface for retrieving job configurations by

spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultJobLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
import org.apache.commons.logging.Log;
2525
import org.apache.commons.logging.LogFactory;
26+
import org.jspecify.annotations.Nullable;
2627

2728
import org.springframework.batch.core.job.Job;
2829
import org.springframework.batch.core.step.Step;
@@ -34,7 +35,6 @@
3435
import org.springframework.beans.factory.InitializingBean;
3536
import org.springframework.context.ApplicationContext;
3637
import org.springframework.context.ConfigurableApplicationContext;
37-
import org.springframework.lang.Nullable;
3838
import org.springframework.util.Assert;
3939

4040
/**

spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GroupAwareJob.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
1515
*/
1616
package org.springframework.batch.core.configuration.support;
1717

18+
import org.jspecify.annotations.Nullable;
19+
1820
import org.springframework.batch.core.job.Job;
1921
import org.springframework.batch.core.job.JobExecution;
2022
import org.springframework.batch.core.job.parameters.JobParametersIncrementer;
2123
import org.springframework.batch.core.job.parameters.JobParametersValidator;
22-
import org.springframework.lang.Nullable;
2324
import org.springframework.util.ClassUtils;
2425

2526
/**
@@ -87,8 +88,7 @@ public boolean isRestartable() {
8788
}
8889

8990
@Override
90-
@Nullable
91-
public JobParametersIncrementer getJobParametersIncrementer() {
91+
public @Nullable JobParametersIncrementer getJobParametersIncrementer() {
9292
return delegate.getJobParametersIncrementer();
9393
}
9494

spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/MapJobRegistry.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
import org.apache.commons.logging.Log;
2525
import org.apache.commons.logging.LogFactory;
26+
import org.jspecify.annotations.Nullable;
27+
2628
import org.springframework.batch.core.job.Job;
2729
import org.springframework.batch.core.configuration.DuplicateJobException;
2830
import org.springframework.batch.core.configuration.JobRegistry;
@@ -31,7 +33,6 @@
3133
import org.springframework.beans.factory.SmartInitializingSingleton;
3234
import org.springframework.context.ApplicationContext;
3335
import org.springframework.context.ApplicationContextAware;
34-
import org.springframework.lang.Nullable;
3536
import org.springframework.util.Assert;
3637

3738
/**

spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/MapStepRegistry.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import java.util.concurrent.ConcurrentMap;
2323

2424
import org.springframework.batch.core.step.Step;
25+
26+
import org.jspecify.annotations.Nullable;
2527
import org.springframework.batch.core.configuration.DuplicateJobException;
2628
import org.springframework.batch.core.configuration.StepRegistry;
2729
import org.springframework.batch.core.launch.NoSuchJobException;
@@ -62,7 +64,7 @@ public void unregisterStepsFromJob(String jobName) {
6264
}
6365

6466
@Override
65-
public Step getStep(String jobName, String stepName) throws NoSuchJobException {
67+
public @Nullable Step getStep(String jobName, String stepName) throws NoSuchJobException {
6668
Assert.notNull(jobName, "The job name cannot be null.");
6769
Assert.notNull(stepName, "The step name cannot be null.");
6870
if (!map.containsKey(jobName)) {

spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/ExceptionElementParser.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@
2222
import org.springframework.beans.factory.support.ManagedMap;
2323
import org.springframework.beans.factory.xml.ParserContext;
2424
import org.springframework.util.xml.DomUtils;
25+
26+
import org.jspecify.annotations.Nullable;
2527
import org.w3c.dom.Element;
2628

2729
public class ExceptionElementParser {
2830

29-
public ManagedMap<TypedStringValue, Boolean> parse(Element element, ParserContext parserContext,
31+
public @Nullable ManagedMap<TypedStringValue, Boolean> parse(Element element, ParserContext parserContext,
3032
String exceptionListName) {
3133
List<Element> children = DomUtils.getChildElementsByTagName(element, exceptionListName);
3234
if (children.size() == 1) {

spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParser.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
import org.springframework.beans.factory.xml.ParserContext;
3131
import org.springframework.util.StringUtils;
3232
import org.springframework.util.xml.DomUtils;
33+
34+
import org.jspecify.annotations.Nullable;
3335
import org.w3c.dom.Element;
3436

3537
/**
@@ -158,7 +160,7 @@ else if (listenersElements.size() > 1) {
158160
* @param parserContext The {@link ParserContext}.
159161
* @return the {@link BeanMetadataElement} extracted from the element parameter.
160162
*/
161-
public BeanMetadataElement parseBeanElement(Element element, ParserContext parserContext) {
163+
public @Nullable BeanMetadataElement parseBeanElement(Element element, ParserContext parserContext) {
162164
String refAttribute = element.getAttribute(REF_ATTR);
163165
Element beanElement = DomUtils.getChildElementByTagName(element, BEAN_ELE);
164166
Element refElement = DomUtils.getChildElementByTagName(element, REF_ELE);

spring-batch-core/src/main/java/org/springframework/batch/core/converter/DefaultJobParametersConverter.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@
2020
import java.util.Properties;
2121

2222
import org.springframework.batch.core.job.parameters.JobParameter;
23+
24+
import org.jspecify.annotations.NonNull;
25+
import org.jspecify.annotations.Nullable;
2326
import org.springframework.batch.core.job.parameters.JobParameters;
2427
import org.springframework.batch.core.job.parameters.JobParametersBuilder;
2528
import org.springframework.core.convert.support.ConfigurableConversionService;
2629
import org.springframework.core.convert.support.DefaultConversionService;
27-
import org.springframework.lang.NonNull;
28-
import org.springframework.lang.Nullable;
2930
import org.springframework.util.Assert;
3031
import org.springframework.util.StringUtils;
3132

spring-batch-core/src/main/java/org/springframework/batch/core/converter/JobParametersConverter.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
import org.springframework.batch.core.job.parameters.JobParameters;
2222
import org.springframework.batch.core.job.parameters.JobParametersBuilder;
2323
import org.springframework.lang.Nullable;
24+
import org.springframework.batch.core.JobParameters;
25+
26+
import org.jspecify.annotations.Nullable;
27+
import org.springframework.batch.core.JobParametersBuilder;
2428

2529
/**
2630
* A factory for {@link JobParameters} instances. A job can be executed with many possible

0 commit comments

Comments
 (0)