JLS 6.6.2 not implemented correctly

XMLWordPrintable

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: P4
    • None
    • Affects Version/s: 1.2.0
    • Component/s: tools
    • generic
    • generic



      Name: igT44549 Date: 02/10/99


      The following illegal Java program is accepted by javac:

      package othello;

      public class M2 extends desdemona.Main {
          public static void main (String[] args) {
              int x = desdemona.Main.staticProtectedMainRoutine();
          }
      }

      package desdemona;

      public class Main {
          static protected int staticProtectedMainRoutine() {
             return 1;
          }
      }

      A conforming JVM, when one eventually exists, will reject M2's class file
      at link-time/run-time, even if the compiler accepts it.

      For details, see JLS 6.6.2 (Details on protected access). The point is that
      the qualifying type must be M2 or a _subclass_ of M2.
      (Review ID: 54014)
      ======================================================================

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: