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),
"");