[ 
https://issues.apache.org/jira/browse/DRILL-6656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16565888#comment-16565888
 ] 

ASF GitHub Bot commented on DRILL-6656:
---------------------------------------

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:
us...@infra.apache.org


> Add Regex To Disallow Extra Semicolons In Imports
> -------------------------------------------------
>
>                 Key: DRILL-6656
>                 URL: https://issues.apache.org/jira/browse/DRILL-6656
>             Project: Apache Drill
>          Issue Type: Improvement
>            Reporter: Timothy Farkas
>            Assignee: Timothy Farkas
>            Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to