alex-plekhanov commented on a change in pull request #9690: IntelliJ inspection 
and checkstyle rule for "Collection.EMPTY_* field accesses replaceable with 
Collections.empty*()"
URL: https://github.com/apache/druid/pull/9690#discussion_r409848503
 
 

 ##########
 File path: codestyle/checkstyle.xml
 ##########
 @@ -325,5 +325,11 @@ codestyle/checkstyle.xml.
"/>
 
     <module name="StringLiteralEquality"/>
 
+    <module name="Regexp">
+      <property name="format" 
value="Collections\.(EMPTY_LIST|EMPTY_MAP|EMPTY_SET)"/>
+      <property name="message" value="Use Collections.empty*() method instead 
of Collection.EMPTY_* field"/>
+      <property name="illegalPattern" value="true"/>
+    </module>
 
 Review comment:
   In this case, you are right. Looks like it's not easy to make identical to 
IntelliJ inspection check by regexp.
   
   But generally, additional checkstyle rule makes sense sometimes, since not 
all developers use IntelliJ products and checkstyle allows to verify code 
locally, before submitting to CI. 
   
   I've reverted checkstyle rule.
   

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to