-
Notifications
You must be signed in to change notification settings - Fork 738
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moves nestmates host loading to visibility check
Earlier nest mates spec draft loaded a class's nest host during class loading. More recent nest mates spec puts off host loading until required for an access check. This commit moves the nest host loading and verification to the visibility check. The spec draft for checking visibility states: To determine whether a class or interface C belongs to the same nest as D (that is, whether C and D are nestmates), the following steps are performed: 1. If C and D are the same class or interface, they belong to the same nest. 2. Otherwise, the nest host of D, H, is determined. If an exception is thrown, the nest membership test fails for the same reason. 3. Otherwise, the nest host of C, H', is determined. If an exception is thrown, the nest membership test fails for the same reason. 4. Otherwise, C and D belong to the same nest if H and H' are the same class or interface. To determine the nest host of a class M, the following steps are performed: 1. If M lacks a NestHost attribute (4.7.28), M is its own nest host. 2. Otherwise, where i is the host_class_index item of M's NestHost attribute, the symbolic reference at index i of M's run-time constant pool is resolved to a class or interface H (5.4.3.1). Any of the exceptions pertaining to class or interface resolution can be thrown. 3. If resolution of H succeeds, but H is not declared in the same run-time package as M, an IncompatibleClassChangeError is thrown. 4. Otherwise, if H lacks a NestMembers attribute (4.7.29), or if, where M has name N, there exists no entry in the classes array of the NestMembers attribute of H that refers to a class or interface with name N, an IncompatibleClassChangeError is thrown. 5. Otherwise, H is the nest host of M. As taken from here: http://cr.openjdk.java.net/~dlsmith/nestmates.html Signed-off-by: Talia McCormick <Talia.McCormick@ibm.com>
- Loading branch information
Talia McCormick
authored and
Talia McCormick
committed
Mar 6, 2018
1 parent
f07f963
commit 6a882d3
Showing
6 changed files
with
151 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters