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

Javac fails to import class defined in the same compilation unit

XMLWordPrintable

    • generic
    • generic



      Name: elR10090 Date: 08/28/2000



      Java 2 SDK 1.4.0beta-b29 fails to compile the folowing
      trivial sample:

          import a;
          class a {}

      Following is the compilation log:

          >>>> jdk1.4.0beta-b29/bin/javac a.java
          a.java:1: a is already defined in this compilation unit
          import a;
          ^
          1 error

      However, I could not find if JLS prohibits to import a class
      defined in the same compilation unit.

      Please note, that earlier Javac versions in JDK 1.1.x, 1.2.x,
      and 1.3 does compile this sample successfully.

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

            wmaddoxsunw William Maddox (Inactive)
            latkinsunw Latkin Latkin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: