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

clss06603.html: JLS8.2.1.1 access to method inherited from non-public class

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.3.0
    • 1.3.0
    • tools
    • beta
    • generic, sparc
    • generic, solaris_2.5.1

      A test based on 4123980 has been added to the JCK. Compiling this
      test should result in a compile-time error; however it compiles
      successfully with the new compiler (jdk1.3d). Since this problem was
      previously fixed in jdk1.2, the new behaviour represents a regression.

      lang/CLSS/clss066/clss06603/clss06603.html

      The following is a simplification of this test:

      FILE: a/AccessMethNonPubClsA.java

      package a;

      import b.AccessMethNonPubClsB;

      public class AccessMethNonPubClsA extends OtherClass {
          public static void main(String argv[]) {
      System.out.println("failed!");
          }
      }

      class OtherClass {
          void inaccessibleMethod() {
          }
      }

      FILE: b/AccessMethNonPubClsB.java

      package b;

      import a.AccessMethNonPubClsA;

      public class AccessMethNonPubClsB extends AccessMethNonPubClsA {
      }

      COMPILE COMMAND:

      $ javac -classpath . b/AccessMethNonPubClsB.java a/AccessMethNonPubClsA.java

      iris.garcia@eng 1999-05-21

            wmaddoxsunw William Maddox (Inactive)
            iris Iris Clark
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: