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

Private inner class accessible from subclasses

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 6
    • tools
    • generic
    • generic

      ###@###.### 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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: