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

new javac permits inheritence of default method

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1
    • Resolution: Duplicate
    • Affects Version/s: 1.3.0
    • Fix Version/s: None
    • Component/s: tools
    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.5.1

      Description



      Name: ngC57085 Date: 06/25/99



      Java compiler jdk1.3H successfully compiles next JCK-122 test,
      checking inheritence of default method from another package non-public
      class

      lang/CLSS/clss06633/clss06603/clss06603.html

      instead of error message:

      >java -version
      java version "1.3"
      Classic VM (build JDK-1.3-H, green threads, sunwjit)

      > javac -d . clss06603.java clss06603a.java
      > java avasoft.sqe.tests.lang.clss066.clss06603.clss06603
      failed!
      >

      The oldjavac reports error message.

      > oldjavac -d . clss06603.java clss06603a.java
      clss06603.java:27: No method matching inaccessibleMethod() found in class javasoft.sqe.tests.lang.clss066.clss06603.clss06603c.
      inaccessibleMethod();
      ^
      1 error
      >

      -----------------clss06603.java------------------
      // Ident: @(#)clss06603.java 1.1 99/02/05
      // Copyright 02/05/99 Sun Microsystems, Inc. All Rights Reserved

      package javasoft.sqe.tests.lang.clss066.clss06603;

      import javasoft.sqe.tests.lang.clss066.clss06603a.clss06603a;
      import java.io.PrintStream;

      public class clss06603 extends clss06603b {
          public static void main(String argv[]) {
      System.exit(run(argv, System.out) + 95/*STATUS_TEMP*/);
          }
          
          public static int run(String argv[], PrintStream out) {
      out.println("failed!");
      return 0/*STATUS_PASSED*/;
          }
      }

      class clss06603b {
          void inaccessibleMethod() {
          }
      }

      class clss06603c extends clss06603a {
          void intermediateMethod(){
      inaccessibleMethod();
          }
      }
      ----------------------------------------------------
      -----------------clss06603a.java------------------
      // Ident: @(#)clss06603a.java 1.1 99/02/05
      // Copyright 02/05/99 Sun Microsystems, Inc. All Rights Reserved

      package javasoft.sqe.tests.lang.clss066.clss06603a;

      import javasoft.sqe.tests.lang.clss066.clss06603.clss06603;

      public class clss06603a extends clss06603 {
      }
      ----------------------------------------------------


      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                iris Iris Clark
                Reporter:
                duke J. Duke (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: