Groovy Documentation

org.codenarc.rule.concurrency
Class ThreadLocalNotStaticFinalRule

java.lang.Object
  org.codenarc.rule.AbstractRule
      org.codenarc.rule.AbstractAstVisitorRule
          org.codenarc.rule.concurrency.ThreadLocalNotStaticFinalRule

class ThreadLocalNotStaticFinalRule
extends AbstractAstVisitorRule

ThreadLocal fields should be static and final. In the most common case a java.lang.ThreadLocal instance associates state with a thread. A non-static non-final java.lang.ThreadLocal field associates state with an instance-thread combination. This is seldom necessary and often a bug which can cause memory leaks and possibly incorrect behavior.

author:
Hamlet D'Arcy
version:
$Revision: 342 $ - $Date: 2010-05-04 21:34:34 -0400 (Tue, 04 May 2010) $


Property Summary
Class astVisitorClass

String name

int priority

 
Constructor Summary
ThreadLocalNotStaticFinalRule()

 
Method Summary
 
Methods inherited from class AbstractAstVisitorRule
shouldApplyThisRuleTo
 
Methods inherited from class AbstractRule
applyTo, createViolation, createViolation, createViolationForImport, createViolationForImport, getImportsSortedByLineNumber, getName, getPriority, packageNameForImport, setName, setPriority, sourceLineAndNumberForImport, sourceLineAndNumberForImport
 

Property Detail

astVisitorClass

Class astVisitorClass


name

String name


priority

int priority


 
Constructor Detail

ThreadLocalNotStaticFinalRule

ThreadLocalNotStaticFinalRule()


 

Groovy Documentation