mirror of
https://github.com/github/codeql.git
synced 2026-04-24 00:05:14 +02:00
Check nullness pass knows pattern case variables can't be null
This commit is contained in:
@@ -14,7 +14,7 @@ public class G {
|
||||
|
||||
switch(s) { // BAD; lack of a null case means this may throw.
|
||||
case "foo" -> System.out.println("Foo");
|
||||
default -> System.out.println("Something else");
|
||||
case String s2 -> System.out.println("Other string of length " + s2.length());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user