[9] RFR (XS): 8046903: VM anonymous class members can't be statically invocable

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Mon Jun 16 16:50:39 UTC 2014


j.l.i.InvokerBytecodeGenerator::isStaticallyInvocable doesn't 
distinguish between VM anonymous classes and ordinary classes. In some 
very specific circumstances (VM anonymous class declared in one of 
predefined core packages), it can consider a member of VM anonymous 
class as statically invocable and symbolically reference it from 
generated bytecode. It's wrong because such class can't be looked up by 
name and the attempt to run such code ends up with NoClassDefFoundError.

The fix is to disable static invocation for members of VM anonymous classes.

Testing: regression test.


Best regards,
Vladimir Ivanov

More information about the core-libs-dev mailing list