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

compiler should never create package/class ambiguity

    XMLWordPrintable

Details

    • generic, sparc
    • solaris_2.5, solaris_2.5.1

    Description

      The JLS states in section 7.1:

      "A package may not contain a type declaration and a subpackage of the same
      name, or a compile-time error results."

      The compiler does not hesitate to create such ambiguities. It will create a class which collides with a package:

      package java;

      public class util {
      }

      And it will create a package which collides with a class:

      package java.lang.String;
       
      public class Bad {
      }

      The compiler should be modified to give helpful error messages when these situations occur.

      Bug report 4027499 includes this behavior and others, but it is more broad and not as specific.

      todd.turnidge@Eng 1997-12-29

      Attachments

        Issue Links

          Activity

            People

              wmaddoxsunw William Maddox (Inactive)
              tturnidgsunw Todd Turnidge (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: