Updated nestmates spec

Dan Smith daniel.smith at oracle.com
Tue Oct 17 21:40:06 UTC 2017

I've made another update.

http://cr.openjdk.java.net/~dlsmith/nestmates.html <http://cr.openjdk.java.net/~dlsmith/nestmates.html>

It seemed inappropriate to be ignoring errors arising during resolution of the NestHost class (other than indirectly prompting IllegalAccessErrors). And, in the worst case, some errors like OutOfMemoryError unquestionably need to be passed on to users, not swallowed by access checking.

So I've rewritten 5.4.4 to stop trying to define "is accessible" and instead describe an "access checking" process that performs some error checks. This is more verbose but also more precise about exactly when resolution and its associated errors are allowed to happen.

It's possible that APIs and tools outside of the JVM spec will want a definition of the total functions "is accessible" or "nest host". This change shifts responsibility of defining those functions (and behavior in the presence of errors) to the outside APIs/tools. If that's problematic, feedback on this point is welcome.


> On Oct 6, 2017, at 12:00 PM, Dan Smith <daniel.smith at oracle.com> wrote:
> I've posted an update to the nestmates spec based on discussions of the last few months.
> http://cr.openjdk.java.net/~dlsmith/nestmates.html
> Significant changes:
> - Renamed MemberOfNest --> NestHost, per some requests; it seems more consistent with names of other attributes
> - Eliminated checking of the NestHost attribute during verification. This means the nest of a class is computed lazily when access is requested, and we have to account for live classes whose NestHost attribute is invalid
> I considered and rejected a proposal to guard 'invokeinterface' behavior changes on the class file version number. Consensus was that behavioral changes that replace errors with successful execution are acceptable when running old class files.
> Feedback is always welcome.
> —Dan

More information about the valhalla-spec-observers mailing list