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

javac allows import statement for current class, contrary to JLS 8.1 p.129

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 1.4.0
    • 1.1
    • tools
    • merlin
    • generic
    • solaris_2.5.1
    • Verified

    Description

      When a java class contains an import statement which names itself,
      fastjavac declares an error (and javac doesn't).

      import A;
      public class A {
       A() {}
      }

      Java WorkShop 2.0 fastjavac 1.0 Copyright (c) 1997 Sun Microsystems, Inc.
      A.java:2: Class name A clashes with imported class on line 1
      public class A {
                   ^
      1 error

      This turns up all over our code as a result of a preprocessor which expands
      import statements with "*" to an explicit list of classes.

      Attachments

        Activity

          People

            busersunw Btplusnull User (Inactive)
            foliversunw Fred Oliver (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: