You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2018/08/01 19:53:54 UTC

[GitHub] ilooner opened a new pull request #1415: DRILL-6656: Disallow extra semicolons in import statements.

ilooner opened a new pull request #1415: DRILL-6656: Disallow extra semicolons in import statements.
URL: https://github.com/apache/drill/pull/1415
 
 
   Due to this jdk bug https://bugs.openjdk.java.net/browse/JDK-8072390, IntelliJ and openjdk 7 and 8 allow extra semicolons in imports. This is technically disallowed by the java spec and results in a compilation issue in eclipse. This resulted in this issue https://issues.apache.org/jira/browse/DRILL-6650. This change adds some checkstyle regexes to prevent a similar mistake from being repeated.
   
   This PR adds the following checkstyle checks:
   
   1. Disallow lines starting with a semicolon.
   2. Disallow two consecutive semicolons separated by nothing but whitespace. 
   3. Disallowing empty statements in java statements. This check does not effect semicolons in imports; however, since we are already fixing semicolons in imports we might as well fix them everywhere.
   
   The first two checks catch semicolons in imports, but as a side effect also detect strange usages of semicolons in the body of a java files. As a result things like the following are disallowed as well:
   
   ```
   for (;;
   ) {
   }
   ```
   
   or 
   
   ```
   new Builder()
      .someStuff()
      .thatStuff()
     .build()
   ;
   ```
   
   But I think we should disallow these strange usages of imports anyway.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services