JDK-8049898 : BootstrapMethodError is thrown for method reference with intersection type bound
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8u40,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2014-07-10
  • Updated: 2015-11-09
  • Resolved: 2015-11-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Resolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
BootstrapMethodError is thrown for the following code:

interface Fun {
    <T extends String & Runnable> String m(T p);
}

class A {
    public static <S extends Runnable> String methodS(S a) {
        return null;
    }

}

public class Test  {
    public static void main(String argv[]) {
        Fun f = A::methodS;
    }
}


Exception in thread "main" java.lang.BootstrapMethodError: call site initialization exception
	at java.lang.invoke.CallSite.makeSite(CallSite.java:328)
	at java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(MethodHandleNatives.java:307)
	at java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:297)
	at Test.main(Test.java:14)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:484)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Caused by: java.lang.invoke.LambdaConversionException: Type mismatch for lambda argument 0: class java.lang.String is not convertible to interface java.lang.Runnable
	at java.lang.invoke.AbstractValidatingLambdaMetafactory.validateMetafactoryArgs(AbstractValidatingLambdaMetafactory.java:267)
	at java.lang.invoke.LambdaMetafactory.metafactory(LambdaMetafactory.java:303)
	at java.lang.invoke.CallSite.makeSite(CallSite.java:289)
	... 8 more
Comments
This defect went away as of http://hg.openjdk.java.net/jdk9/dev/langtools/rev/3c5de506a1f2 made on behalf of JDK-8065821
09-11-2015

This bug is not reproducible on JDK 9 dev anymore. I'll investigate how it got fixed and whether this should be closed as duplicate and if so of what defect.
09-11-2015

On 21.07.2014 13:08, Victor Rudometov wrote: > > Hello. > > * the test is not present in JCK 8 > yes > > * this is not a regression in product JDK 8u20 > yes > > Thanks. > Victor.
21-07-2014

8u20-defer-request justification: very very rare and obscure issue. The fix is involved and risky. Propose to defer to JDK 9.
14-07-2014

The following JCK 8a tests fail: lang/INFR/infr081/infr08101m11/infr08101m11.html lang/INFR/infr081/infr08101m91/infr08101m91.html
10-07-2014