Details
-
Enhancement
-
Resolution: Fixed
-
P4
-
7
-
None
-
Verified
Description
JLS7 13.1 says: "Every nested class must have a symbolic reference to its immediately enclosing class."
This should be: "Every nested class and nested interface must have a symbolic reference to its immediately enclosing class (8.1.3)."
JLS7 13.1 also says: "Every class that contains a nested class must contain symbolic references to all of its member classes, and to all local and anonymous classes that appear in its methods, constructors, and static or instance initializers."
This rule applies when a class contains a nested interface, not just a nested class. The rule should be: "Every class must contain symbolic references to all of its member types (8.5), and to all local and anonymous classes that appear in its methods, constructors, static initializers, instance initializers, and field initializers." In addition, the rule applies when an _interface_ contains a nested class or nested interface, so the following rule should be added: "Every interface must contain symbolic references to all of its member types (9.5), and to all anonymous classes that appear in its field initializers."
This should be: "Every nested class and nested interface must have a symbolic reference to its immediately enclosing class (8.1.3)."
JLS7 13.1 also says: "Every class that contains a nested class must contain symbolic references to all of its member classes, and to all local and anonymous classes that appear in its methods, constructors, and static or instance initializers."
This rule applies when a class contains a nested interface, not just a nested class. The rule should be: "Every class must contain symbolic references to all of its member types (8.5), and to all local and anonymous classes that appear in its methods, constructors, static initializers, instance initializers, and field initializers." In addition, the rule applies when an _interface_ contains a nested class or nested interface, so the following rule should be added: "Every interface must contain symbolic references to all of its member types (9.5), and to all anonymous classes that appear in its field initializers."
Attachments
Issue Links
- relates to
-
JDK-8020068 Clarify attribute descriptions
-
- Closed
-