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

name00705.html: JLS6.3 private members should not be inherited from superclasses

XMLWordPrintable

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

      A test based on 4122297 has been added to the JCK. The test should
      compile successfully, however it fails with the new compiler
      (jdk1.3d). Since this problem was previously fixed in jdk1.2, the new
      behaviour represents a regression.

      lang/NAME/name007/name00705/name00705.html

      The following is a simplification of that test:

      FILE: PvtMbrsNotInherit1.java

      public class PvtMbrsNotInherit extends OtherClass {
          public static void main(String args[]) {
      java.lang.Long.toString(0);
          }
      }

      class OtherClass {
           private int java;
      }

      OUTPUT:

      $ java -fullversion
      java full version "JDK-1.3-D"
      $ javac PvtMbrsNotInherit1.java
      PvtMbrsNotInherit1.java:3: variable java has private access in class OtherClass
              java.lang.Long.toString(0);
              ^
      PvtMbrsNotInherit1.java:3: int cannot be dereferenced
              java.lang.Long.toString(0);
                  ^
      2 errors

      iris.garcia@eng 1999-05-21


      Name: ssC76496 Date: 07/28/99


      Private members are not inherited from superclasses in JDK1.3-L build.
      ###@###.###, 28 Jun 99.
      ======================================================================

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: