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

Javac fails to import class defined in the same compilation unit

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description



      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.

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

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: