Updated JEP: nestmates

David Holmes david.holmes at oracle.com
Thu Apr 13 21:51:28 UTC 2017


On 14/04/2017 3:09 AM, John Rose wrote:
> On Apr 13, 2017, at 4:36 AM, David Holmes <david.holmes at oracle.com> wrote:
>
>>> you can not modify nest definition attributes at runtime using java.lang.instrument.
>>
>> Yes.
>
> I'm missing something here. Why must nestmate attributes be specifically hardened against instrumentation changes? Can't instrumentation, in general, change any aspect of a classfile?

Instrumentation is primarily about adding bytecodes to methods. There 
are strict constraints on what instrumentation can change with respect 
to the "shape" of a type (members, inheritance hierarchy).

"The retransformation may change method bodies, the constant pool and 
attributes. The retransformation must not add, remove or rename fields 
or methods, change the signatures of methods, change modifiers, or 
change inheritance.". [ JVM TI spec.]

Similarly for redefinition, which also adds " or change inheritance".

So no changes to super-types. And now no changes to nest membership.

David



More information about the valhalla-dev mailing list