NPE is expected but not thrown when the invocationName is null:
SwitchBootstraps.enumSwitch(
MethodHandles.lookup(),
null,
MethodType.methodType(int.class, FooEnum.class, int.class),
"FOO", "BAR", "BAZ");
Label takes entries that are not in names of enum constants:
// enum FooEnum {FOO, BAR, BAZ, BING}
CallSite callSite = SwitchBootstraps.enumSwitch(
MethodHandles.lookup(),
"_",
MethodType.methodType(int.class, FooEnum.class, int.class),
"A", "B");
Null string in label throws an IllegalArgumentException but not documented:
// enum FooEnum {FOO, BAR, BAZ, BING}
CallSite callSite = SwitchBootstraps.enumSwitch(
MethodHandles.lookup(),
"_",
MethodType.methodType(int.class, FooEnum.class, int.class),
"");
SwitchBootstraps.enumSwitch(
MethodHandles.lookup(),
null,
MethodType.methodType(int.class, FooEnum.class, int.class),
"FOO", "BAR", "BAZ");
Label takes entries that are not in names of enum constants:
// enum FooEnum {FOO, BAR, BAZ, BING}
CallSite callSite = SwitchBootstraps.enumSwitch(
MethodHandles.lookup(),
"_",
MethodType.methodType(int.class, FooEnum.class, int.class),
"A", "B");
Null string in label throws an IllegalArgumentException but not documented:
// enum FooEnum {FOO, BAR, BAZ, BING}
CallSite callSite = SwitchBootstraps.enumSwitch(
MethodHandles.lookup(),
"_",
MethodType.methodType(int.class, FooEnum.class, int.class),
"");
- csr for
-
JDK-8368085 SwitchBootstraps.enumSwitch() args not checked as documented
-
- Closed
-
- links to
-
Commit(master) openjdk/jdk/86211956
-
Review(master) openjdk/jdk/27422