Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8310910 | 22 | Archie Cobbs | P3 | Resolved | Fixed | b04 |
JDK-8311356 | 21.0.1 | Archie Cobbs | P3 | Resolved | Fixed | b02 |
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?
$ 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?
- backported by
-
JDK-8310910 javac rejects semicolons in compilation units with no imports
- Resolved
-
JDK-8311356 javac rejects semicolons in compilation units with no imports
- Resolved
- relates to
-
JDK-8315452 Erroneous AST missing modifiers for partial input
- Resolved
-
JDK-8027682 javac wrongly accepts semicolons in package and import decls
- Resolved
- links to
-
Commit openjdk/jdk21/359bd63b
-
Commit openjdk/jdk/a08352f6
-
Review openjdk/jdk21/64
-
Review openjdk/jdk/13361
(3 links to)