[Nestmates] RFR: 8191114: [Nestmates] Update access control exception handling and other features per final JVMS proposal
David Holmes
david.holmes at oracle.com
Wed Dec 13 07:31:44 UTC 2017
Bug: https://bugs.openjdk.java.net/browse/JDK-8191114
webrev: http://cr.openjdk.java.net/~dholmes/8191114/webrev/
The final proposed changes to the JVMS have been discussed by the EG and
it is time to bring everything into line with the proposed spec.
The main changes are:
- Process for determining the nest-host has changed, specifically:
- same package check is done first**
- IncompatibleClassChangeError is thrown instead of IllegalAccessError
- A self-reference is permitted in the NestMembers array
- A self-reference is not permitted in the NestHost attribute
- Duplicate entries are permitted in the NestMembers array
- Invokeinterface use for private interface methods is permitted
regardless of classfile version (so no exception saying "you should use
invokespecial").
** This had a disruptive impact on the tests as using Object and
Object[] as "bad hosts" now hit the "not in same package" error instead
of the intended error - so these had to be replaced with a new class
defined in the same (unnamed) package.
All tests were updated to match the changes, and new tests added where
needed. In particular:
- nest membership tests had to add the bad "SelfHost" case
- reflection API getNestMembers() had to allow for and test,
self-reference and duplicate entries [the spec is being clarified under
JDK-8193408]
Some minor cleanups:
- src/hotspot/share/classfile/stackMapFrame.hpp
- reverted leftover copyright year change (file is not modified from
mainline version)
- src/hotspot/share/classfile/verifier.cpp
- reverted leftover layout and whitespace changes (file is not
modified from mainline version)
Thanks,
David
More information about the valhalla-dev
mailing list