Details
Description
As reported here:
https://mail.openjdk.java.net/pipermail/compiler-dev/2021-August/017768.html
A NPE should be reported for:
---
public void foo(Object o) {
switch (o) {
default: break;
case String s :System.out.println(s); break;
}
}
public static void main(String[] args) {
(new X()).foo(null); // NPE expected, but prints null
}
---
but it is not.
https://mail.openjdk.java.net/pipermail/compiler-dev/2021-August/017768.html
A NPE should be reported for:
---
public void foo(Object o) {
switch (o) {
default: break;
case String s :System.out.println(s); break;
}
}
public static void main(String[] args) {
(new X()).foo(null); // NPE expected, but prints null
}
---
but it is not.