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

Missing semi in import statement causes compiler exception

XMLWordPrintable

    • 1.0beta
    • sparc
    • solaris_2.3
    • Not verified

      I was compiling an applet that began

      - - - - - - - - - - - - - - - - - - - - - - - -
      /* multi-line comments bla bla bla */

      import awt.*
      import net.www.html.URL;
      - - - - - - - - - - - - - - - - - - - - - - - -

      (notice the missing ';' after the 'awt.*') and got the right error
      message from the compiler, except that the compiler first threw an
      exception. Here it is:

      - - - - - - - - - - - - - - - - - - - - - - - -
      java.tools.java.SyntaxError
              at java.lang.Exception.<init>(Exception.java)
              at java.tools.java.SyntaxError.<init>(SyntaxError.java)
              at java.tools.java.Parser.expect(Parser.java)
              at java.tools.java.Parser.parseFile(Parser.java)
              at java.tools.javac.BatchEnvironment.parseFile(BatchEnvironment.java)
              at java.tools.javac.Main.compile(Main.java)
              at java.tools.javac.Main.main(Main.java)
      Bookmark.java:20: ';' expected.
      import awt.*
                  ^
      1 error

      - - - - - - - - - - - - - - - - - - - - - - - -

            ahoffsunw Arthur Hoff (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: