Double-semicolon in import statements

Jeremy Manson jeremymanson at google.com
Thu Aug 1 10:12:33 PDT 2013


Hi folks,

Another one that came up was that javac allows an empty statement between
import statements.  This doesn't *seem* to be allowed by the JLS's grammar
(JLS 7.5), so it should probably either be clarified in the JLS or fixed.
 Example:

import java.util.HashMap;;

public class Semicolon {
  public static void main(String[] args) {
     System.out.println("This program should not compile");
  }
}

compiles.

Jeremy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20130801/8cb2fd3d/attachment-0001.html 


More information about the compiler-dev mailing list