The following test case:
public class Test {
public static void main(String[] args) throws Exception {
java.lang.invoke.MethodHandles.constant(boolean.class, true);
}
}
throws an exception:
Exception in thread "main" java.lang.ExceptionInInitializerError
at Test.main(Test.java:5)
Caused by: java.lang.IllegalArgumentException: no leading reference parameter: true
at java.lang.invoke.MethodHandleStatics.newIllegalArgumentException(MethodHandleStatics.java:81)
at java.lang.invoke.MethodHandle.bindTo(MethodHandle.java:1009)
at java.lang.invoke.MethodHandles.constant(MethodHandles.java:1625)
...