Summary
Invoking SwitchBoostraps.enumSwitch with a null lookup should always throw a NullPointerException.
Problem
Invoking SwitchBoostraps.enumSwitch with a null lookup does not always throw a NullPointerException. The lookup is already needed in some cases, and during future evolution, the set of cases where lookup will be needed may change. The method should always throw a NullPointerException when the lookup parameter is null.
Solution
SwitchBoostraps.enumSwitch will explicitly check that the lookup parameter is not null.
Specification
No change to the specification, the specification already disallows the lookup parameter to be null. The behavior will be changed for that SwitchBoostraps.enumSwitch will always and unconditionally throw a NullPointerException when the lookup parameter is null.
- csr of
-
JDK-8375119 SwitchBoostraps.enumSwitch does not throw an NPE when lookup is null in some cases
-
- Open
-