Updated JEP: nestmates

David Holmes david.holmes at oracle.com
Sat Apr 15 00:18:59 UTC 2017

On 15/04/2017 8:00 AM, Peter Levart wrote:
> On 04/14/2017 10:34 PM, John Rose wrote:
>> Regarding javac:  It would be polite if javac were to agree that if
>> the output classfile
>> has an InnerClasses attribute, and the current class either records an
>> outer-class
>> or the current class*is*  an outer-class, then the classfile will also
>> have one of the
>> nestmate attributes.
>> But the system has to be robust if javac drops the ball once in a while.
>> And it certainly has to read down-rev class files correctly.
> ...at first it appears that down-rev files might not need to be treated
> as nest-mates on the basis of their InnerClasses attributes. They have
> access bridges to communicate.
> But someone might want to "inject" a dynamically generated nestmate into
> a self-nest of an old-rev top-level class then which communicates with
> nested classes via bridges and expect from this dynamically generated
> class to have access to private members of nested classes too. So
> treating down-rev files' InnerClasses attributes as nestmate metadata
> might be necessary.

There is no scope for "injection of dynamically generated nestmates" in 
the current JEP. I'm not even sure what that means in terms of 
classfiles and bytecode. There would be no bridges in the old-rev 
top-level class to allow access from the generated "nestmate".

My expectation is that classfile version 53- treats nested types exactly 
as today. Classfile version 54+ uses the new nestmate attributes and 
does need to generate private accessors. The two worlds should be quite 


> Regards, Peter

More information about the valhalla-dev mailing list