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

importing of non-existed subpackge is permited

    Details

    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.5

      Description



      Name: ngC57085 Date: 04/26/97



      Java compiler (JDK1.1.2) permits to use a type-import-on-demand declaration of non-existed package. This occurs in the case when imported package is a subpackage of some package and this package contain a type declaration and a subpackage of the same name.

      JLS (7.5.2) says:

      "
      It is a compile-time error for a type-import-on-demand declaration to name
      a package that is not accessible (6.6), as determined by the host system (7.2).
      "

      Next test is successfully compiled by jdk instead of error message.

      > javac -d . pkgs02602.java
      > java -verify javasoft.sqe.tests.lang.pkgs026.pkgs02602.pkgs02602
      > echo $status
      97
      >

      ------------------------pkgs02602--------------
      package javasoft.sqe.tests.lang.pkgs026.pkgs02602;

      import java.io.PrintStream;
      import javasoft.sqe.tests.lang.pkgs026.pkgs02602.pkgs02602.*;

      public class pkgs02602 {
        public static void main(String argv[]) {
           System.exit(run(argv, System.out) + 95/*STATUS_TEMP*/);
        }
        public static int run(String argv[],PrintStream out) {
           return 2/*STATUS_FAILED*/;
        }
      }
      --------------------------------------




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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tturnidgsunw Todd Turnidge (Inactive)
                Reporter:
                duke J. Duke (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: