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

javac rejects semicolons in compilation units with no imports

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 21
    • None
    • tools
    • None
    • b29

    Backports

      Description

        After JDK-8027682, javac rejects compilation units like the following:

        $ cat T.java
        package p;;

        $ javac -fullversion T.java
        javac full version "21-ea+16-1326"
        T.java:2: error: reached end of file while parsing
        1 error

        Is this a bug? I expected it to reject semi-colons preceding imports, but if there are no imports, isn't the the semi-colon a valid empty type declaration?

        Attachments

          Issue Links

            Activity

              People

                acobbs Archie Cobbs
                cushon Liam Miller-Cushon
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: