[ https://issues.apache.org/jira/browse/DRILL-6656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16568675#comment-16568675 ]
ASF GitHub Bot commented on DRILL-6656: --------------------------------------- ilooner commented on a change in pull request #1415: DRILL-6656: Disallow extra semicolons in import statements. URL: https://github.com/apache/drill/pull/1415#discussion_r207648664 ########## File path: src/main/resources/checkstyle-config.xml ########## @@ -35,11 +35,26 @@ <module name="AvoidStarImport"/> <module name="NeedBraces"/> + <module name="EmptyStatement"/> </module> <module name="FileTabCharacter"/> + <!-- + Due to a bug in openjdk 7 and 8, extra semicolons in import statements are allowed. However, these extra semicolons can cause compilation failures with other java + distributions since they are technically disallowed by the java spec. These two regexes prevent extra semicolons in import statements. As an extra side-effect they also + disallow certain usages of semicolons elsewhere in the body of a java file. But we are okay with disallowing strange placement of semicolons in those other cases. + --> + <module name="RegexpSingleline"> + <property name="format" value=";\s*;$"/> + <property name="message" value="A line of code cannot end with multiple semicolons."/> + </module> + <module name="RegexpSingleline"> Review comment: Looks like NoWhitespaceBefore does work for imports so it works for these cases: ``` import com.mystuff.MyClass; ; ``` or ``` import com.mystuff.MyClass; ; ``` But I will still have to add a regex to detect this ``` import com.stuff.MyClass;; ``` None of the existing checks you mentioned catch this. Thanks for pointing these things out, it makes things much cleaner. ---------------------------------------------------------------- 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 > Fix For: 1.15.0 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)