-
Bug
-
Resolution: Not an Issue
-
P4
-
repo-valhalla
-
None
-
generic
-
generic
This class:
public primitive class CheckRefLambda.val {
int theInteger;
public CheckRefLambda(int newValue) {
theInteger = newValue;
}
public Supplier<CheckRefLambda.ref> makeCopier() {
return () -> new CheckRefLambda(this.theInteger + 1);
}
// ...
}
won't bootstrap the lambda, but fails with:
java.lang.BootstrapMethodError: bootstrap method initialization exception
at java.base/java.lang.invoke.BootstrapMethodInvoker.invoke(BootstrapMethodInvoker.java:188)
at java.base/java.lang.invoke.CallSite.makeSite(CallSite.java:315)
at java.base/java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(MethodHandleNatives.java:281)
at java.base/java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:271)
at CheckRefLambda.makeCopyer(CheckRefLambda.java:42)
at CheckRefLambda.main(CheckRefLambda.java:47)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:569)
at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:312)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.invoke.LambdaConversionException: Invalid receiver type primitive CheckRefLambda; not a subtype of implementation type primitive CheckRefLambda
at java.base/java.lang.invoke.AbstractValidatingLambdaMetafactory.validateMetafactoryArgs(AbstractValidatingLambdaMetafactory.java:271)
at java.base/java.lang.invoke.LambdaMetafactory.metafactory(LambdaMetafactory.java:340)
at java.base/java.lang.invoke.BootstrapMethodInvoker.invoke(BootstrapMethodInvoker.java:134)
... 11 more
public primitive class CheckRefLambda.val {
int theInteger;
public CheckRefLambda(int newValue) {
theInteger = newValue;
}
public Supplier<CheckRefLambda.ref> makeCopier() {
return () -> new CheckRefLambda(this.theInteger + 1);
}
// ...
}
won't bootstrap the lambda, but fails with:
java.lang.BootstrapMethodError: bootstrap method initialization exception
at java.base/java.lang.invoke.BootstrapMethodInvoker.invoke(BootstrapMethodInvoker.java:188)
at java.base/java.lang.invoke.CallSite.makeSite(CallSite.java:315)
at java.base/java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(MethodHandleNatives.java:281)
at java.base/java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:271)
at CheckRefLambda.makeCopyer(CheckRefLambda.java:42)
at CheckRefLambda.main(CheckRefLambda.java:47)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:569)
at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:312)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.invoke.LambdaConversionException: Invalid receiver type primitive CheckRefLambda; not a subtype of implementation type primitive CheckRefLambda
at java.base/java.lang.invoke.AbstractValidatingLambdaMetafactory.validateMetafactoryArgs(AbstractValidatingLambdaMetafactory.java:271)
at java.base/java.lang.invoke.LambdaMetafactory.metafactory(LambdaMetafactory.java:340)
at java.base/java.lang.invoke.BootstrapMethodInvoker.invoke(BootstrapMethodInvoker.java:134)
... 11 more
- relates to
-
JDK-8274399 [lworld] LambdaConversionException thrown when the receiver type is a primitive reference type and the implementation type is the primitive value type of the same class
-
- Resolved
-
- links to
-
Review openjdk/valhalla/545