Skip to content

Commit e94c5a7

Browse files
committed
Check nullness pass knows pattern case variables can't be null
1 parent ca43b96 commit e94c5a7

File tree

1 file changed

+1
-1
lines changed
  • java/ql/test/query-tests/Nullness

1 file changed

+1
-1
lines changed

java/ql/test/query-tests/Nullness/G.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public static void test(String s) {
1414

1515
switch(s) { // BAD; lack of a null case means this may throw.
1616
case "foo" -> System.out.println("Foo");
17-
default -> System.out.println("Something else");
17+
case String s2 -> System.out.println("Other string of length " + s2.length());
1818
}
1919

2020
}

0 commit comments

Comments
 (0)