JDK-8031096 : invokestatic: IncompatibleClassChangeError is thrown instead of AbstractMethodError
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: hs25
  • Priority: P3
  • Status: Resolved
  • Resolution: Not an Issue
  • Submitted: 2013-12-30
  • Updated: 2014-01-22
  • Resolved: 2014-01-17
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 8
8u20Resolved
Related Reports
Relates :  
Relates :  
Description
Consider the following case:
   public interface I1 { default public void m() {}} 
   public interface I2 extends I1 { public void m(); } 
   public class T3 implements I2 {} 

Call site: T3 { invokestatic T3.m()V T3 } 

NB: T3 isn't marked as abstract.

VM: IncompatibleClassChangeError: Expected static method p1.T3.m()I
JVMS: AbstractMethodError should be thrown

Please, note that if I1.m is absent, AME is thrown as expected.

JVMS-5.4.3.3. Method Resolution
"[I]f method lookup succeeds and the method is abstract, but C is not abstract, method resolution throws an AbstractMethodError."

JVMS-6.5 invokestatic.
"Linking Exceptions
During resolution of the symbolic reference to the method, any of the exceptions pertaining to method resolution (��5.4.3.3) can be thrown.
Otherwise, if the resolved method is an instance method, the invokestatic instruction throws an IncompatibleClassChangeError."

ILW = HLM = P3 

I = H = JVMS violation; though error mismatch isn't that serious, it adds noise into the results and hinders results analysis of default method security testing 
L = L = forbidden by JLS, but separate compilation may be a source of that 
W = M = Incorrect exception can be "translated" if necessary
Comments
Based on recent JVM spec changes noticed by Lois it's been decided that this is not a bug. Throwing an ICCE exception is the correct behavior in this case.
17-01-2014

Lois, I agree with your reasoning. ICCE is expected in this situation. Regarding notion of "instance" and "interface" methods in JVMS: Though I have an impression that "Linking Exceptions" section in JVMS-6.5 invokestatic differentiates between instance/interface and static method, it'd good to get some clarification from JVMS experts.
16-01-2014

Release team: Approved for deferral.
10-01-2014

Given the developer's assessment that the problem is not a major or a showstopper, SQE is OK with deferral to jdk8u20
09-01-2014

According to the latest JSR 335 spec, 0.9.1 at http://cr.openjdk.java.net/~dlsmith/jsr335-0.9.1.html, the section referred to above: JVMS-5.4.3.3. Method Resolution "[I]f method lookup succeeds and the method is abstract, but C is not abstract, method resolution throws an AbstractMethodError." has been removed. There is further explanation within JVMS-5.4.3.3 noting the motivation behind this change. Given this one could argue that the ICCE is correct. The only hitch is that the resolved method is not an "instance" method. Justification for the AME may instead fall under the first sentence within invokestatic's "Linking Exceptions" section.
09-01-2014