RFR: 8143317: jdk/lambda/vm/InterfaceAccessFlagsTest.java fails with IncompatibleClassChangeError

Paul Sandoz paul.sandoz at oracle.com
Wed Jan 13 08:47:04 UTC 2016


Hi Yumin,

Sorry for the delay.

Looks good.

Minor suggestion:

  78                     cpool.add(newEntry);
  79                 } else {
  80                     cpool.add(ce);
  81                 }
  82             } else {
  83                 cpool.add(ce);
  84             }
  85         }
You can collapse all those cpool.add calls to one outside of the instanceof if block if you do "ce = newEntry” rather than “cpool.add(newEntry)”.

Paul.

> On 8 Jan 2016, at 19:13, Yumin Qi <yumin.qi at oracle.com> wrote:
> 
> Please review
> 
> Bug: https://bugs.openjdk.java.net/browse/JDK-8143317
> Weberv: http://cr.openjdk.java.net/~minqi/8143317/webrev-01/
> 
> Description: When bug 8145148(https://bugs.openjdk.java.net/browse/JDK-8145148) pushed (it replaced 8087223, will be integrated), the test case InterfaceAccessFlagsTest.java will fail on inconsistent method tag. The fix of 8145148 requires that generated bytecodes follows
> 
> JVMS-5.4.3.3 Method Resolution:
> " If C is an interface, method resolution throws an IncompatibleClassChangeError."
> JVMS-5.4.3.4 Interface Method Resolution:
> "If C is not an interface, interface method resolution throws an IncompatibleClassChangeError"
> 
> When converting a class to interface in *ClassToInterfaceConverter.java*, it only deletes "<init>" function from the class, and modifies the class flag to be interface flag. In this case, we have function "m" to call "priv" in the same class  "I", after conversion to interface "I", "m" invokes "priv" in the same interface (they are default methods). This requires "priv" in constant pool with tag of InterfaceMethodref, but the conversion does not change the tag to InterfaceMethodref (it keeps tag as Methodref).
> 
> Added code to convert the invoked Methodref to InterfaceMethodref.
> 
> Tests: JPRT, jtreg on InterfaceAccessFlags.java, passed for binaries for pre-8145148  and 8145148.
> 
> Thanks
> Yumin
> 
> 
> 
> 
> 
> 
> 



More information about the jdk9-dev mailing list