Example:
public class Test {
public static void main(String ... args) {
System.out.println(test((Integer)1234));
}
static int test(Number n) {
return switch (n) {
case Integer in -> {
yield 1;
}
default -> {
yield 0;
}
};
}
}
This will be the starting point.
https://github.com/openjdk/jdk/blob/8b16897b74cfdc3c2693e3ae7e05f3d8c6468ebe/src/hotspot/share/cds/aotConstantPoolResolver.cpp#L465-L489
The bootstrap method to check is java/lang/runtime/SwitchBootstraps::typeSwitch
public class Test {
public static void main(String ... args) {
System.out.println(test((Integer)1234));
}
static int test(Number n) {
return switch (n) {
case Integer in -> {
yield 1;
}
default -> {
yield 0;
}
};
}
}
This will be the starting point.
https://github.com/openjdk/jdk/blob/8b16897b74cfdc3c2693e3ae7e05f3d8c6468ebe/src/hotspot/share/cds/aotConstantPoolResolver.cpp#L465-L489
The bootstrap method to check is java/lang/runtime/SwitchBootstraps::typeSwitch