-
Bug
-
Resolution: Fixed
-
P3
-
17
-
b14
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8294393 | 17.0.6-oracle | Jan Lahoda | P3 | Resolved | Fixed | b01 |
JDK-8293854 | 17.0.6 | Yuri Nesterenko | P3 | Resolved | Fixed | b01 |
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.
- backported by
-
JDK-8293854 NullPointerException not reported
-
- Resolved
-
-
JDK-8294393 NullPointerException not reported
-
- Resolved
-
- links to
-
Commit openjdk/jdk17u-dev/6f6b0722
-
Commit openjdk/jdk/93eec9a1
-
Review openjdk/jdk17u-dev/667
-
Review openjdk/jdk/5312
(1 links to)