Skip to content

Commit 8506e9b

Browse files
committed
Refine contribution #1201
- Remove separate profile for jSpecify checks - Update errorprone and nullaway versions - Add jSpecify checks in test and test-autoconfigure modules - Exclude o.s.shell.test.jediterm from jSpecify checks (as it's a shaded fork) - Remove usage of org.springframework.lang.Nullable Resolves #1184
1 parent 63eb82e commit 8506e9b

File tree

12 files changed

+43
-62
lines changed

12 files changed

+43
-62
lines changed

.github/workflows/ci-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ jobs:
2020
cache: 'maven'
2121

2222
- name: Build with Maven
23-
run: ./mvnw --no-transfer-progress --batch-mode --update-snapshots verify -Pnullaway
23+
run: ./mvnw --no-transfer-progress --batch-mode --update-snapshots verify
2424

pom.xml

Lines changed: 22 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
<commons-io.version>2.20.0</commons-io.version>
5757
<slf4j.version>2.0.17</slf4j.version>
5858
<jakarta.validation-api.version>3.1.1</jakarta.validation-api.version>
59-
<errorprone.version>2.36.0</errorprone.version>
60-
<nullaway.version>0.12.7</nullaway.version>
59+
<errorprone.version>2.42.0</errorprone.version>
60+
<nullaway.version>0.12.10</nullaway.version>
6161
<jspecify.version>1.0.0</jspecify.version>
6262

6363
<!-- test dependencies -->
@@ -107,7 +107,27 @@
107107
<release>${java.version}</release>
108108
<compilerArgs>
109109
<compilerArg>-parameters</compilerArg>
110+
<compilerArg>
111+
-XDcompilePolicy=simple
112+
--should-stop=ifError=FLOW
113+
-Xplugin:ErrorProne
114+
-Xep:NullAway:ERROR
115+
-XepOpt:NullAway:JSpecifyMode=true
116+
-XepOpt:NullAway:OnlyNullMarked=true
117+
</compilerArg>
110118
</compilerArgs>
119+
<annotationProcessorPaths>
120+
<path>
121+
<groupId>com.google.errorprone</groupId>
122+
<artifactId>error_prone_core</artifactId>
123+
<version>${errorprone.version}</version>
124+
</path>
125+
<path>
126+
<groupId>com.uber.nullaway</groupId>
127+
<artifactId>nullaway</artifactId>
128+
<version>${nullaway.version}</version>
129+
</path>
130+
</annotationProcessorPaths>
111131
</configuration>
112132
</plugin>
113133
<plugin>
@@ -231,59 +251,6 @@
231251
</plugins>
232252
</build>
233253

234-
<profiles>
235-
<profile>
236-
<id>nullaway</id>
237-
<build>
238-
<plugins>
239-
<plugin>
240-
<groupId>org.apache.maven.plugins</groupId>
241-
<artifactId>maven-compiler-plugin</artifactId>
242-
<configuration>
243-
<showWarnings>true</showWarnings>
244-
245-
</configuration>
246-
<executions>
247-
<execution>
248-
<id>default-compile</id>
249-
<phase>none</phase>
250-
</execution>
251-
<execution>
252-
<id>java-compile</id>
253-
<phase>compile</phase>
254-
<goals>
255-
<goal>compile</goal>
256-
</goals>
257-
<configuration>
258-
<annotationProcessorPaths>
259-
<path>
260-
<groupId>com.google.errorprone</groupId>
261-
<artifactId>error_prone_core</artifactId>
262-
<version>${errorprone.version}</version>
263-
</path>
264-
<path>
265-
<groupId>com.uber.nullaway</groupId>
266-
<artifactId>nullaway</artifactId>
267-
<version>${nullaway.version}</version>
268-
</path>
269-
</annotationProcessorPaths>
270-
<compilerArgs>
271-
<arg>-XDcompilePolicy=simple</arg>
272-
<arg>--should-stop=ifError=FLOW</arg>
273-
<arg>-Xplugin:ErrorProne -XepDisableAllChecks -Xep:NullAway:ERROR
274-
-XepOpt:NullAway:OnlyNullMarked=true
275-
-XepOpt:NullAway:CustomContractAnnotations=org.springframework.lang.Contract
276-
</arg>
277-
</compilerArgs>
278-
</configuration>
279-
</execution>
280-
</executions>
281-
</plugin>
282-
</plugins>
283-
</build>
284-
</profile>
285-
</profiles>
286-
287254
<repositories>
288255
<repository>
289256
<id>maven-central</id>

spring-shell-core/src/main/java/org/springframework/shell/DefaultShellApplicationRunner.java

Whitespace-only changes.

spring-shell-core/src/main/java/org/springframework/shell/command/ArgumentHeaderMethodArgumentResolver.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
import java.util.Arrays;
1919
import java.util.List;
2020

21+
import org.jspecify.annotations.Nullable;
22+
2123
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
2224
import org.springframework.core.MethodParameter;
2325
import org.springframework.core.convert.ConversionService;
24-
import org.springframework.lang.Nullable;
2526
import org.springframework.messaging.Message;
2627
import org.springframework.messaging.MessageHandlingException;
2728
import org.springframework.messaging.handler.annotation.Header;

spring-shell-core/src/main/java/org/springframework/shell/command/parser/DirectiveResult.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package org.springframework.shell.command.parser;
1717

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

2020
/**
2121
* Encapsulating {@code Directive} with its fields, {@code name} and

spring-shell-samples/spring-shell-sample-catalog/src/main/java/org/springframework/shell/samples/catalog/scenario/Scenario.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package org.springframework.shell.samples.catalog.scenario;
1717

18-
import org.springframework.lang.Nullable;
18+
import org.jspecify.annotations.Nullable;
1919
import org.springframework.shell.tui.component.view.TerminalUI;
2020
import org.springframework.shell.tui.component.view.control.View;
2121
import org.springframework.shell.samples.catalog.Catalog;

spring-shell-standard/src/main/java/org/springframework/shell/standard/ShellOptionMethodArgumentResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
2323
import org.springframework.core.MethodParameter;
2424
import org.springframework.core.convert.ConversionService;
25-
import org.springframework.lang.Nullable;
25+
import org.jspecify.annotations.Nullable;
2626
import org.springframework.messaging.Message;
2727
import org.springframework.messaging.MessageHandlingException;
2828
import org.springframework.shell.support.AbstractArgumentMethodArgumentResolver;

spring-shell-standard/src/main/java/org/springframework/shell/standard/commands/StandardCommandsModelsRuntimeHints.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import org.springframework.aot.hint.RuntimeHints;
2424
import org.springframework.aot.hint.RuntimeHintsRegistrar;
2525
import org.springframework.aot.hint.TypeReference;
26-
import org.springframework.lang.Nullable;
26+
import org.jspecify.annotations.Nullable;
2727

2828
/**
2929
* {@link RuntimeHintsRegistrar} for Shell Standard Commands temlate model classes.

spring-shell-standard/src/main/java/org/springframework/shell/standard/commands/StandardCommandsResourcesRuntimeHints.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import org.springframework.aot.hint.RuntimeHints;
1919
import org.springframework.aot.hint.RuntimeHintsRegistrar;
20-
import org.springframework.lang.Nullable;
20+
import org.jspecify.annotations.Nullable;
2121

2222
/**
2323
* {@link RuntimeHintsRegistrar} for Shell Standard Commands resources.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@NullMarked
2+
package org.springframework.shell.test.autoconfigure;
3+
4+
import org.jspecify.annotations.NullMarked;

0 commit comments

Comments
 (0)