JDK-8143317 : jdk/lambda/vm/InterfaceAccessFlagsTest.java fails with IncompatibleClassChangeError
  • Type: Bug
  • Component: core-libs
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-11-19
  • Updated: 2021-09-23
  • Resolved: 2016-01-15
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 JDK 9
8u321Fixed 9 b105Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
test vm.InterfaceAccessFlagsTest.testPrivateMethodCall(): failure
java.lang.AssertionError: Unexpected exception: java.lang.IncompatibleClassChangeError: Resolving to non interface method I.priv()I
	at org.testng.Assert.fail(Assert.java:94)
	at vm.InterfaceAccessFlagsTest.testMethodCallWithFlag(InterfaceAccessFlagsTest.java:66)
	at vm.InterfaceAccessFlagsTest.testPrivateMethodCall(InterfaceAccessFlagsTest.java:76)
	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:520)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
	at org.testng.TestRunner.privateRun(TestRunner.java:767)
	at org.testng.TestRunner.run(TestRunner.java:617)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
	at org.testng.SuiteRunner.run(SuiteRunner.java:240)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
	at org.testng.TestNG.run(TestNG.java:1057)
	at com.sun.javatest.regtest.TestNGAction$TestNGRunner.main(TestNGAction.java:163)
	at com.sun.javatest.regtest.TestNGAction$TestNGRunner.main(TestNGAction.java:147)
	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:520)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:92)
	at java.lang.Thread.run(Thread.java:747)
Test InterfaceAccessFlagsTest.testPrivateMethodCall FAILED
config separate.TestHarness.printError(org.testng.internal.TestResult@1157a5f9): success
config separate.TestHarness.reset(): success
test vm.InterfaceAccessFlagsTest.testPrivateStaticMethodCall(): failure
java.lang.AssertionError: Unexpected exception: java.lang.IncompatibleClassChangeError: Resolving to non interface method I.priv()I
	at org.testng.Assert.fail(Assert.java:94)
	at vm.InterfaceAccessFlagsTest.testMethodCallWithFlag(InterfaceAccessFlagsTest.java:66)
	at vm.InterfaceAccessFlagsTest.testPrivateStaticMethodCall(InterfaceAccessFlagsTest.java:86)
	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:520)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
	at org.testng.TestRunner.privateRun(TestRunner.java:767)
	at org.testng.TestRunner.run(TestRunner.java:617)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
	at org.testng.SuiteRunner.run(SuiteRunner.java:240)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
	at org.testng.TestNG.run(TestNG.java:1057)
	at com.sun.javatest.regtest.TestNGAction$TestNGRunner.main(TestNGAction.java:163)
	at com.sun.javatest.regtest.TestNGAction$TestNGRunner.main(TestNGAction.java:147)
	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:520)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:92)
	at java.lang.Thread.run(Thread.java:747)
Test InterfaceAccessFlagsTest.testPrivateStaticMethodCall FAILED
config separate.TestHarness.printError(org.testng.internal.TestResult@22d337e2): success
config separate.TestHarness.reset(): success
test vm.InterfaceAccessFlagsTest.testStaticMethodCall(): failure
java.lang.AssertionError: Unexpected exception: java.lang.IncompatibleClassChangeError: Resolving to non interface method I.priv()I
	at org.testng.Assert.fail(Assert.java:94)
	at vm.InterfaceAccessFlagsTest.testMethodCallWithFlag(InterfaceAccessFlagsTest.java:66)
	at vm.InterfaceAccessFlagsTest.testStaticMethodCall(InterfaceAccessFlagsTest.java:81)
	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:520)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
	at org.testng.TestRunner.privateRun(TestRunner.java:767)
	at org.testng.TestRunner.run(TestRunner.java:617)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
	at org.testng.SuiteRunner.run(SuiteRunner.java:240)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
	at org.testng.TestNG.run(TestNG.java:1057)
	at com.sun.javatest.regtest.TestNGAction$TestNGRunner.main(TestNGAction.java:163)
	at com.sun.javatest.regtest.TestNGAction$TestNGRunner.main(TestNGAction.java:147)
	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:520)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:92)
	at java.lang.Thread.run(Thread.java:747)
Test InterfaceAccessFlagsTest.testStaticMethodCall FAILED
config separate.TestHarness.printError(org.testng.internal.TestResult@12af5519): success
config separate.TestHarness.reset(): success

===============================================
jdk/lambda/vm/InterfaceAccessFlagsTest.java
Total tests run: 3, Failures: 3, Skips: 0
===============================================

----------System.err:(14/796)----------
java.lang.Exception: failures: 3
	at com.sun.javatest.regtest.TestNGAction$TestNGRunner.main(TestNGAction.java:166)
	at com.sun.javatest.regtest.TestNGAction$TestNGRunner.main(TestNGAction.java:147)
	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:520)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:92)
	at java.lang.Thread.run(Thread.java:747)

JavaTest Message: Test threw exception: java.lang.Exception: failures: 3
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.lang.Exception: failures: 3
Comments
URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/14716231231b User: lana Date: 2016-02-10 21:55:24 +0000
10-02-2016

URL: http://hg.openjdk.java.net/jdk9/hs-rt/jdk/rev/14716231231b User: minqi Date: 2016-01-15 23:36:03 +0000
15-01-2016

--- a/test/jdk/lambda/separate/ClassToInterfaceConverter.java Fri Dec 18 08:30:26 2015 +0100 +++ b/test/jdk/lambda/separate/ClassToInterfaceConverter.java Thu Jan 07 20:07:53 2016 -0800 @@ -62,6 +62,30 @@ } } cf.methods = new_methods; + // Convert method tag. Find Methodref, which is not "<init>" and only invoked by other methods + // in the interface, convert it to InterfaceMethodref + ArrayList<ClassFile.CpEntry> cpool = new ArrayList<>(); + for (int i = 0; i < cf.constant_pool.size(); i++) { + ClassFile.CpEntry ce = cf.constant_pool.get(i); + if (ce instanceof ClassFile.CpMethodRef) { + ClassFile.CpMethodRef me = (ClassFile.CpMethodRef)ce; + ClassFile.CpNameAndType nameType = (ClassFile.CpNameAndType)cf.constant_pool.get(me.name_and_type_index); + ClassFile.CpEntry name = cf.constant_pool.get(nameType.name_index); + if (!utf8Matches(name, "<init>") && cf.this_class == me.class_index) { + ClassFile.CpInterfaceMethodRef newEntry = new ClassFile.CpInterfaceMethodRef(); + newEntry.class_index = me.class_index; + newEntry.name_and_type_index = me.name_and_type_index; + cpool.add(newEntry); + } else { + cpool.add(ce); + } + } else { + cpool.add(ce); + } + } + cf.constant_pool = cpool; }
08-01-2016

This is a test failure --- bug 8145148 will fail the test. 8087223 caused this failure, but the fix of 8087223 is not an issue, the issues caused by that fix caused tests failed on the new code for jvm spec checking.
15-12-2015

I think this bug was being used to fix some broken test(s).
14-12-2015

This will be fixed as part of JDK-8145148
14-12-2015

The test should be modified to fit the jvm spec mentioned in 8087223.
10-12-2015

This is tracking the original problem in the bug whose fix was backed out, so I adjusted the priority to match this.
08-12-2015

JDK-8143317 (this bug) and JDK-8143320 were filed to document different test failures observed in the nightly. This was before the failures were root caused to the fix for JDK-8087223. After the root cause was determined, Christian created a subtask for JDK-8143320 to backout the fix for JDK-8087223 and that subtask has the bug ID of JDK-8143324. This bug JDK-8143317 and JDK-8143320 remain open for Yumin to use to create a revised version of his fix for JDK-8087223.
01-12-2015

Not clear why JDK-8143324 was created to do the backout instead of using this bug - which is now orphaned.
01-12-2015

I'm not sure why this is still open though, I thought backing out JDK-8087223 fix resolved this.
30-11-2015

The test case use: Compiler compiler = new Compiler(/*Compiler.Flags.VERBOSE*/); compiler.addPostprocessor(new ClassToInterfaceConverter("I")); Check the ClassToInterfaceConverter: private void convertToInterface(ClassFile cf) { cf.access_flags = 0x0601; // ACC_INTERFACE | ACC_ABSTRACT | ACC_PUBLIC ArrayList<ClassFile.Method> new_methods = new ArrayList<>(); // Find <init> method and delete it for (int i = 0; i < cf.methods.size(); ++i) { ClassFile.Method method = cf.methods.get(i); ClassFile.CpEntry name = cf.constant_pool.get(method.name_index); if (!utf8Matches(name, "<init>")) { new_methods.add(method); } } cf.methods = new_methods; } What it changes is just modify the flags, and delete "<init>" method. Since it did not modify the method tag ---- the corresponding "Methodref" => "InterfaceMethodref" so the failure is expected.
20-11-2015