Illegal access to protected nested class

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 1.3.0
    • Affects Version/s: 1.3.0
    • Component/s: tools
    • rc2
    • generic
    • generic

      Consider the following code:

      package otherpkg;

      public class PublicC {

        protected class ProtectedMem {}
      }

      package thispkg;

      class Lucky {
      otherpkg.PublicC.ProtectedMem z; // Allowed by gjc!
      class Tricky2 extends otherpkg.PublicC{}
      }

      javac (in 1.3) accepts this. It does not accept it in 1.2. This code is illegal
      according to the JLS 2nd edition (6.6.1, 6.6.2).

      gilad.bracha@eng 2000-01-26

            Assignee:
            William Maddox (Inactive)
            Reporter:
            Gilad Bracha (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: