Skip to content

Commit 4efe485

Browse files
committed
Set DataFlowIssue as NullAway suppression name alias
1 parent e6cc575 commit 4efe485

File tree

69 files changed

+196
-192
lines changed

Some content is hidden

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

69 files changed

+196
-192
lines changed

documentation/src/test/java/example/session/HttpTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public boolean supportsParameter(ParameterContext parameterContext, ExtensionCon
5050
}
5151

5252
//end::user_guide[]
53-
@SuppressWarnings({ "DataFlowIssue", "NullAway" })
53+
@SuppressWarnings("DataFlowIssue")
5454
//tag::user_guide[]
5555
@Override
5656
public Object resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext) {

documentation/src/test/java/example/sharedresources/SharedResourceDemo.java

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

2525
class SharedResourceDemo {
2626

27-
@SuppressWarnings({ "DataFlowIssue", "NullAway" })
27+
@SuppressWarnings("DataFlowIssue")
2828
//tag::user_guide[]
2929
@Test
3030
void runBothCustomEnginesTest() {

documentation/src/test/java/example/timing/TimingExtension.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void beforeTestExecution(ExtensionContext context) {
4141
}
4242

4343
//end::user_guide[]
44-
@SuppressWarnings({ "DataFlowIssue", "NullAway" })
44+
@SuppressWarnings("DataFlowIssue")
4545
//tag::user_guide[]
4646
@Override
4747
public void afterTestExecution(ExtensionContext context) {

gradle/libs.versions.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ mockito-bom = { module = "org.mockito:mockito-bom", version = "5.18.0" }
5959
mockito-core = { module = "org.mockito:mockito-core" }
6060
mockito-junit-jupiter = { module = "org.mockito:mockito-junit-jupiter" }
6161
nohttp-checkstyle = { module = "io.spring.nohttp:nohttp-checkstyle", version = "0.0.11" }
62-
nullaway = { module = "com.uber.nullaway:nullaway", version = "0.12.7" }
62+
# FIXME replace with release
63+
nullaway = { module = "com.uber.nullaway:nullaway", version = "0.12.8-SNAPSHOT" }
6364
opentest4j = { module = "org.opentest4j:opentest4j", version.ref = "opentest4j" }
6465
openTestReporting-cli = { module = "org.opentest4j.reporting:open-test-reporting-cli", version.ref = "openTestReporting" }
6566
openTestReporting-events = { module = "org.opentest4j.reporting:open-test-reporting-events", version.ref = "openTestReporting" }

gradle/plugins/common/src/main/kotlin/junitbuild.java-nullability-conventions.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ tasks.withType<JavaCompile>().configureEach {
6464
isJSpecifyMode = true
6565
customContractAnnotations.add("org.junit.platform.commons.annotation.Contract")
6666
checkContracts = true
67+
// FIXME a new gradle-nullaway-plugin version is needed for a proper DSL
68+
checkOptions.put("NullAway:SuppressionNameAliases", "DataFlowIssue")
6769
}
6870
}
6971
}

junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/MethodBasedCondition.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ private boolean invokeConditionMethod(Method method, ExtensionContext context) {
8888
return invokeMethod(method, context, testInstance);
8989
}
9090

91-
@SuppressWarnings({ "DataFlowIssue", "NullAway" })
91+
@SuppressWarnings("DataFlowIssue")
9292
private static boolean invokeMethod(Method method, ExtensionContext context, @Nullable Object testInstance) {
9393
if (method.getParameterCount() == 0) {
9494
return (boolean) ReflectionSupport.invokeMethod(method, testInstance);

jupiter-tests/src/test/java/org/junit/jupiter/api/AssertAllAssertionsTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,25 @@
3737
*/
3838
class AssertAllAssertionsTests {
3939

40-
@SuppressWarnings({ "DataFlowIssue", "NullAway" })
40+
@SuppressWarnings("DataFlowIssue")
4141
@Test
4242
void assertAllWithNullExecutableArray() {
4343
assertPrecondition("executables array must not be null or empty", () -> assertAll((Executable[]) null));
4444
}
4545

46-
@SuppressWarnings({ "DataFlowIssue", "NullAway" })
46+
@SuppressWarnings("DataFlowIssue")
4747
@Test
4848
void assertAllWithNullExecutableCollection() {
4949
assertPrecondition("executables collection must not be null", () -> assertAll((Collection<Executable>) null));
5050
}
5151

52-
@SuppressWarnings({ "DataFlowIssue", "NullAway" })
52+
@SuppressWarnings("DataFlowIssue")
5353
@Test
5454
void assertAllWithNullExecutableStream() {
5555
assertPrecondition("executables stream must not be null", () -> assertAll((Stream<Executable>) null));
5656
}
5757

58-
@SuppressWarnings({ "DataFlowIssue", "NullAway" })
58+
@SuppressWarnings("DataFlowIssue")
5959
@Test
6060
void assertAllWithNullInExecutableArray() {
6161
assertPrecondition("individual executables must not be null", () -> assertAll((Executable) null));

jupiter-tests/src/test/java/org/junit/jupiter/api/AssertLinesMatchAssertionsTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ void assertLinesMatchUsingFastForwardMarkerWithLimit3() {
9595
}
9696

9797
@Test
98-
@SuppressWarnings({ "unchecked", "rawtypes", "DataFlowIssue", "NullAway" })
98+
@SuppressWarnings({ "unchecked", "rawtypes", "DataFlowIssue" })
9999
void assertLinesMatchWithNullFails() {
100100
assertThrows(PreconditionViolationException.class, () -> assertLinesMatch(null, (List) null));
101101
assertThrows(PreconditionViolationException.class, () -> assertLinesMatch(null, Collections.emptyList()));

jupiter-tests/src/test/java/org/junit/jupiter/api/DynamicTestTests.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class DynamicTestTests {
4343

4444
private final List<@Nullable String> assertedValues = new ArrayList<>();
4545

46-
@SuppressWarnings({ "DataFlowIssue", "NullAway" })
46+
@SuppressWarnings("DataFlowIssue")
4747
@Test
4848
void streamFromStreamPreconditions() {
4949
ThrowingConsumer<Object> testExecutor = input -> {
@@ -58,7 +58,7 @@ void streamFromStreamPreconditions() {
5858
() -> DynamicTest.stream(Stream.empty(), displayNameGenerator, null));
5959
}
6060

61-
@SuppressWarnings({ "DataFlowIssue", "NullAway" })
61+
@SuppressWarnings("DataFlowIssue")
6262
@Test
6363
void streamFromIteratorPreconditions() {
6464
ThrowingConsumer<Object> testExecutor = input -> {
@@ -73,7 +73,7 @@ void streamFromIteratorPreconditions() {
7373
() -> DynamicTest.stream(emptyIterator(), displayNameGenerator, null));
7474
}
7575

76-
@SuppressWarnings({ "DataFlowIssue", "NullAway" })
76+
@SuppressWarnings("DataFlowIssue")
7777
@Test
7878
void streamFromStreamWithNamesPreconditions() {
7979
ThrowingConsumer<Object> testExecutor = input -> {
@@ -84,7 +84,7 @@ void streamFromStreamWithNamesPreconditions() {
8484
assertThrows(PreconditionViolationException.class, () -> DynamicTest.stream(Stream.empty(), null));
8585
}
8686

87-
@SuppressWarnings({ "DataFlowIssue", "NullAway" })
87+
@SuppressWarnings("DataFlowIssue")
8888
@Test
8989
void streamFromIteratorWithNamesPreconditions() {
9090
ThrowingConsumer<Object> testExecutor = input -> {
@@ -95,14 +95,14 @@ void streamFromIteratorWithNamesPreconditions() {
9595
assertThrows(PreconditionViolationException.class, () -> DynamicTest.stream(emptyIterator(), null));
9696
}
9797

98-
@SuppressWarnings({ "DataFlowIssue", "NullAway" })
98+
@SuppressWarnings("DataFlowIssue")
9999
@Test
100100
void streamFromStreamWithNamedExecutablesPreconditions() {
101101
assertThrows(PreconditionViolationException.class,
102102
() -> DynamicTest.stream((Stream<DummyNamedExecutableForTests>) null));
103103
}
104104

105-
@SuppressWarnings({ "DataFlowIssue", "NullAway" })
105+
@SuppressWarnings("DataFlowIssue")
106106
@Test
107107
void streamFromIteratorWithNamedExecutablesPreconditions() {
108108
assertThrows(PreconditionViolationException.class,

jupiter-tests/src/test/java/org/junit/jupiter/api/FailAssertionsTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void failWithNullString() {
7474
}
7575
}
7676

77-
@SuppressWarnings({ "DataFlowIssue", "NullAway" })
77+
@SuppressWarnings("DataFlowIssue")
7878
@Test
7979
void failWithNullMessageSupplier() {
8080
try {

0 commit comments

Comments
 (0)