Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4312064

Remove check for hiding of member of enclosing class by inherited member

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.3.0
    • tools
    • beta
    • generic
    • generic
    • Verified

      The current draft of JLS 2e drops the check for access to inherited members
      of an inner class that hide a member declared in an enclosing class. This
      check is required by the current innerclasses spec, and implemented by the
      compiler. The check should be removed.

      ----------

      This refers to the now-obsolete last sentence of the following excerpt from the inner class specification:

      Any inherited member m of a subclass C is in scope within the body of C, including any inner classes within C. If C itself is an inner
      class, there may be definitions of the same kind (variable, method, or type) for m in enclosing scopes. (The scopes may be blocks,
      classes, or packages.) In all such cases, the inherited member m hides the other definitions of m. Additionally, unless the hidden
      definition is a package member, the simple name m is illegal; the programmer must write C.this.m.

      neal.gafter@Eng 2000-11-20

            gafter Neal Gafter (Inactive)
            wmaddoxsunw William Maddox (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: