Consider this testscase:
---
enum E {}
try {
MethodType switchType = MethodType.methodType(int.class, E.class, int.class);
BSM_ENUM_SWITCH.invoke(null, "", switchType,
new Object[] {"A"});
fail("Didn't get the expected exception.");
} catch (NullPointerException ex) {
//OK
}
---
---
enum E {}
try {
MethodType switchType = MethodType.methodType(int.class, E.class, int.class);
BSM_ENUM_SWITCH.invoke(null, "", switchType,
new Object[] {"A"});
fail("Didn't get the expected exception.");
} catch (NullPointerException ex) {
//OK
}
---
- csr for
-
JDK-8375120 SwitchBoostraps.enumSwitch does not throw an NPE when lookup is null in some cases
-
- Draft
-
- links to
-
Review(master)
openjdk/jdk/29202