JDK-8033150 : invokestatic: IncompatibleClassChangeError trying to invoke static method from a parent in presence of conflicting defaults
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: hs25,8
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-01-29
  • Updated: 2014-07-29
  • Resolved: 2014-04-14
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.
8u20Fixed 9 b11Fixed
Related Reports
Blocks :  
Relates :  
Consider the following case:
   public interface I1               { default public void m() {}}
   public interface I2               { default public void m() {}}
   public class T3 implements I1, I2 { public static void m() {}}
   public class T4 extends T3 {}

Call site: invokestatic T4.m 

JVMS: T3.m is invoked.
JVM behavior: IncompatibleClassChangeError: Expected static method p1.T4.m()I

According to JVMS, T4.m resolves to T3.m which should be invoked. 

Test case is attached.

I1.m, I2.m & T3.m are crucial to get the bug to occur. 

The most probable culprit is 8026066 (the test starts failing with 8b120). 

ILW = HLH = P2
I = H = error instead of successful method invocation
L = L = conflicting default methods + static method are required; javac won't compile such hierarchy
W = H = no workaround

The test case attached to this report currently generates an assertion with a JDK 8 and JDK 9 fastdebug build. This has been the case since JDK 8 b124. I tracked down the exact change that caused the issue. I have reported it in JDK-8035602. So before this bug can be fixed and tested, JDK-8035602 will have to be fixed.

Release team: Approved for deferral.

Deferral justification: Not a showstopper since javac will not compile this code. Requesting deferral to 8u20.

Analysis shows that the most probable culprit is 8026066.