You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/01/04 14:28:32 UTC

[GitHub] [druid] leventov commented on issue #8888: Make IntelliJ's inspection "ThreadLocal field not declared static final" a error

leventov commented on issue #8888: Make IntelliJ's inspection "ThreadLocal field not declared static final" a error
URL: https://github.com/apache/druid/issues/8888#issuecomment-570789869
 
 
   The same effect could be attained via Checkstyle:
   ```xml
   <!-- Ensure all ThreadLocal fields are private -->
   <!-- Requires https://github.com/sevntu-checkstyle/sevntu.checkstyle -->
   <module name="AvoidModifiersForTypesCheck">
     <property name="forbiddenClassesRegexpProtected" value="ThreadLocal"/>
     <property name="forbiddenClassesRegexpPublic" value="ThreadLocal"/>
     <property name="forbiddenClassesRegexpPackagePrivate" value="ThreadLocal"/>
   </module>
   
   <!-- Prohibit any ThreadLocal field which is not private static final -->
   <module name="Regexp">
     <property name="id" value="nonStaticThreadLocal"/>
     <property name="format"
       value="^\s*private\s+(ThreadLocal|static\s+ThreadLocal|final\s+ThreadLocal)"/>
     <property name="illegalPattern" value="true"/>
     <property name="message" value="Non-static final ThreadLocal"/>
   </module>
   ```

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org