JDK-8019998 : Clarify compilation of nested classes and nested interfaces
  • Type: Enhancement
  • Component: specification
  • Sub-Component: language
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-07-05
  • Updated: 2014-02-26
  • Resolved: 2013-08-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8Fixed
Related Reports
Relates :  
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."