-
Bug
-
Resolution: Fixed
-
P5
-
7
-
b16
In the compiler-dev thread "Double-semicolon in import statements" [1], it was established that javac allows semicolons in two "interesting" places: 1) after the package declaration and before import declarations, and 2) after one import declaration and before another import declaration. Neither is permitted by the grammar in JLS 7.3. Since Eclipse conforms to the grammar, javac should conform too.
As examples, the following are illegal:
package p; ;;; import X; class Foo {}
package p; import X; ;;; import Y; class Foo {}
while the following is legal (because a top-level ; after the last import declaration represents an "empty" type declaration):
package p; import X; ;;; class Foo {} ;;;
[1] http://mail.openjdk.java.net/pipermail/compiler-dev/2013-August/006956.html
As examples, the following are illegal:
package p; ;;; import X; class Foo {}
package p; import X; ;;; import Y; class Foo {}
while the following is legal (because a top-level ; after the last import declaration represents an "empty" type declaration):
package p; import X; ;;; class Foo {} ;;;
[1] http://mail.openjdk.java.net/pipermail/compiler-dev/2013-August/006956.html
- csr for
-
JDK-8301905 javac wrongly accepts semicolons in package and import decls
- Closed
- duplicates
-
JDK-8072390 extra semicolon between imports does not cause compile error
- Closed
- relates to
-
JDK-8305671 javac rejects semicolons in compilation units with no imports
- Resolved
-
JDK-8309511 Regression test ExtraImportSemicolon.java refers to the wrong bug
- Resolved
-
JDK-6963934 JCCompilationUnit.getImports does not report all imports
- Closed
(2 links to)