Skip to content

Commit

Permalink
more tests of passing null varargs array
Browse files Browse the repository at this point in the history
  • Loading branch information
msridhar committed Sep 1, 2024
1 parent fee21e4 commit 71301a3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public void testNonNullVarargs() {
" Utilities.takesNonNullVarargs(o1);", // Empty var args passed
" // BUG: Diagnostic contains: passing @Nullable parameter 'o4' where @NonNull",
" Utilities.takesNonNullVarargs(o1, o4);",
" Object[] x = null;",
" // BUG: Diagnostic contains: passing @Nullable parameter 'x'",
" Utilities.takesNonNullVarargs(o1, x);",
" }",
"}")
.doTest();
Expand Down
3 changes: 3 additions & 0 deletions nullaway/src/test/java/com/uber/nullaway/VarargsTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public void testNonNullVarargs() {
" Utilities.takesNonNullVarargs(o1);", // Empty var args passed
" // BUG: Diagnostic contains: passing @Nullable parameter 'o4' where @NonNull",
" Utilities.takesNonNullVarargs(o1, o4);",
" Object[] x = null;",
" // BUG: Diagnostic contains: passing @Nullable parameter 'x'",
" Utilities.takesNonNullVarargs(o1, x);",
" }",
"}")
.doTest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ public void testNonNullVarargs() {
" Utilities.takesNonNullVarargs(o1);", // Empty var args passed
" // BUG: Diagnostic contains: passing @Nullable parameter 'o4' where @NonNull",
" Utilities.takesNonNullVarargs(o1, o4);",
" Object[] x = null;",
" // BUG: Diagnostic contains: passing @Nullable parameter 'x'",
" Utilities.takesNonNullVarargs(o1, x);",
" }",
"}")
.doTest();
Expand Down Expand Up @@ -215,7 +218,7 @@ public void testSkipJetbrainsNotNullOnVarArgsFromThirdPartyJars() {
}

@Test
public void typeUseNullableVarargsArrayAndElements() {
public void typeUseNullableVarargsArray() {
makeHelper()
.addSourceLines(
"Utilities.java",
Expand Down

0 comments on commit 71301a3

Please sign in to comment.