javac rejects semicolons in compilation units with no imports

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 21
    • Affects Version/s: None
    • Component/s: tools
    • None
    • b29

        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?

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

                Created:
                Updated:
                Resolved: