Summary
The documentation for SwitchBootstraps.enumSwitch
and SwitchBootstraps.typeSwitch
is not completely in line with the implementation, and could be improved
Problem
- the implementation of both
enumSwitch
andtypeSwitch
acceptnull
as the value ofinvocationName
- the
labels
array forenumSwitch
may contain names of enum constants that don't exist, but the documentation is not clear about this - empty strings are not permitted as values of the
labels
array by the implementation, but the documentation does not state that - the documentation could be clearer about the behavior in the situation when no label matches
Solution
The documentation is adjusted and clarified to match the implementation. No behavioral changes, only adjustments to align the documentation to the existing behavior.
Specification
The proposed API Diff is attached, and is also available for convenience here: https://cr.openjdk.org/~jlahoda/8368085/apidiff.00/java.base/java/lang/runtime/SwitchBootstraps.html
- csr of
-
JDK-8363917 SwitchBootstraps.enumSwitch() args not checked as documented.
-
- Open
-