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

The compiler denies access to the protected inner class by using its full name

XMLWordPrintable

    • rc2
    • sparc
    • solaris_7
    • Verified

      The compiler deny access to the protected inner class by using its full name.
      See example.
      If "A.AInner" change to "AInner", all works correcly.
      This bug appears in the JDK1.3.0rc2-V, JDK1.3.0rc2-U compiler works correctly.
      -------------------example ---------------------
      ------------- A.java --------------------
      package test;
      public class A {
          protected class AInner {
          }
      }
      ------------ B.java ------------------
      import test.A;

      class B extends A {
          public class BInner extends A.AInner {

          }
      }
      ---------------- 1.3.0rc2-V output ---------------
       #>javac -d . A.java B.java
      B.java:4: test.A.AInner has protected access in test.A
          public class BInner extends A.AInner {
                                       ^
      1 error
      -----------------1.3.0rc2-U--------------
       #>javac -d . A.java B.java
      ----------------------------------------

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: