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

Private inner class accessible from subclasses

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 6
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      ###@###.### reports:

      $ cat -n Super.java ; cat -n Sub.java
           1 class Super {
           2 Inner i;
           3 private class Inner {
           4 void bar() {}
           5 }
           6 }
           1 class Sub extends Super {
           2 void foo() { i.bar(); }
           3 }
      $ javac Super.java Sub.java

      No error reported, which seems to violate JLS 6.6.1 (i.bar() should not be accessible).

      ###@###.### 2004-11-10 04:27:36 GMT

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ahe Peter Ahe
                Reporter:
                ahe Peter Ahe
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: