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: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
