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

oldjavac incorrectly interdict inheriting of protected inner classes.

XMLWordPrintable

    • sparc
    • solaris_2.5.1



      Name: aaC67449 Date: 11/01/99



      oldjavac incorrectly interdict inheriting of protected inner classes, when the
      nesting level of inner class is more then 1.

      See example:

      ----------------- example -----------

      ------ A.java ----
      package test;

      public class A {

          protected class AInner1 {

              protected AInner1() {}
              protected class AInner2 {
                   protected AInner2() {}
              }
          }
      }
      ----- B.java ------
      class B extends test.A {

           public class BInner1 extends AInner1 {
              public BInner1() {
                  super();
              }

              public class BInner2 extends AInner2 {
                  public BInner2() {
                      super();
                  }
              }
          }
      }
      ------------------oldjavac output--------------
      #>oldjavac -d . A.java B.java
      B.java:8: Inner type AInner1 in class test.A not accessible from inner class B. BInner1.BInner2.
              public class BInner2 extends AInner2 {
                                           ^
      1 error
      --------------------------
      All works correctly in new javac.
      But the oldjavac is a reference platform for JCK, and some JCK tests are not
      compiled. So the bug in the oldjavac should be fixed.

      ---------------- output ----------
      Failed. The method returns null


      ======================================================================

            wmaddoxsunw William Maddox (Inactive)
            alisunw Ali Ali (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: