Class MultiThreadedCodeIdentifierUtils
java.lang.Object
edu.umd.cs.findbugs.util.MultiThreadedCodeIdentifierUtils
Utility class with methods to identify multithreaded code
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleanhasEnclosingInstanceReference(org.apache.bcel.classfile.JavaClass javaClass) Returns whetherjavaClassis a non-static inner class that holds a reference to an enclosing instance.private static booleanhasMultiThreadedInstruction(org.apache.bcel.generic.MethodGen methodGen) private static booleanisConcurrentLockInterfaceCall(String className, String methodName) private static booleanisDirectlyPartOfMultiThreadedCode(org.apache.bcel.classfile.JavaClass javaClass, ClassContext classContext) private static booleanisFieldIndicatingMultiThreadedContainer(org.apache.bcel.classfile.Field field) private static booleanisFromAtomicPackage(String signature) private static booleanisInstanceOfLock(String className) static booleanisLocked(org.apache.bcel.classfile.Method currentMethod, CFG currentCFG, LockDataflow currentLockDataFlow, int pc) static booleanisMethodMultiThreaded(org.apache.bcel.classfile.Method method, ClassContext classContext) static booleanisNotThreadSafe(ClassContext classContext) static booleanisPartOfMultiThreadedCode(ClassContext classContext)
-
Field Details
-
JAVA_LANG_RUNNABLE
- See Also:
-
ATOMIC_PACKAGE
- See Also:
-
-
Constructor Details
-
MultiThreadedCodeIdentifierUtils
private MultiThreadedCodeIdentifierUtils()
-
-
Method Details
-
isPartOfMultiThreadedCode
-
hasEnclosingInstanceReference
private static boolean hasEnclosingInstanceReference(org.apache.bcel.classfile.JavaClass javaClass) Returns whetherjavaClassis a non-static inner class that holds a reference to an enclosing instance. The compiler emits a syntheticthis$0(orthis$1, ...) field for that reference; static nested classes and top-level classes have no such field, so they do not share an enclosing instance's thread context. -
isDirectlyPartOfMultiThreadedCode
private static boolean isDirectlyPartOfMultiThreadedCode(org.apache.bcel.classfile.JavaClass javaClass, ClassContext classContext) -
isMethodMultiThreaded
public static boolean isMethodMultiThreaded(org.apache.bcel.classfile.Method method, ClassContext classContext) -
hasMultiThreadedInstruction
private static boolean hasMultiThreadedInstruction(org.apache.bcel.generic.MethodGen methodGen) -
isConcurrentLockInterfaceCall
private static boolean isConcurrentLockInterfaceCall(@DottedClassName String className, String methodName) -
isInstanceOfLock
-
isFieldIndicatingMultiThreadedContainer
private static boolean isFieldIndicatingMultiThreadedContainer(org.apache.bcel.classfile.Field field) -
isFromAtomicPackage
-
isLocked
public static boolean isLocked(org.apache.bcel.classfile.Method currentMethod, CFG currentCFG, LockDataflow currentLockDataFlow, int pc) -
isNotThreadSafe
- Returns:
trueif the class is explicitly annotated withNotThreadSafeto document that it is not thread safe
-