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

javac prohibits top-level class named "java"

XMLWordPrintable

    • generic
    • generic



      Name: laC46010 Date: 01/28/99



      The following example shows that javac (ver. 1.1.x, 1.2fcs, 1.2.2) has a
      special treatment of the name "java" of the top-level class containing
      some inner classes

      Test example and javac diagnostics follow:
      -------------------------------------------------------
      novo35% cat test.java
      package root.mypkg;

      class java {
          class any {
          }
      }
      novo35% java -version
      java version "1.2.2"
      Classic VM (build JDK-1.2.2-C, green threads, sunwjit)
      novo35% javac test.java
      test.java:3: Superclass root.mypkg.java. lang.Object of class root.mypkg.java not found.
      class java {
            ^
      test.java:4: Superclass root.mypkg.java. lang.Object of inner class root.mypkg.java. any not
      found.
          class any {
                ^
      2 errors
      -------------------------------------------------------

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

      Name: laC46010 Date: 01/28/99


         More investigation shows that javac doesn't compile
      any top-level classes or interfaces named "java"
      novo35% cat test.java
      package any;
      class java {}

      novo35% javac test.java
      test.java:3: Superclass any.java. lang.Object of class any.java not found.
      class java {}
            ^
      1 error
      --------------------------------------



      ======================================================================
      william.maddox@Eng 1999-01-28

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: