Class MultiThreadedCodeIdentifierUtils

java.lang.Object
edu.umd.cs.findbugs.util.MultiThreadedCodeIdentifierUtils

public class MultiThreadedCodeIdentifierUtils extends Object
Utility class with methods to identify multithreaded code
  • Field Details

  • Constructor Details

    • MultiThreadedCodeIdentifierUtils

      private MultiThreadedCodeIdentifierUtils()
  • Method Details

    • isPartOfMultiThreadedCode

      public static boolean isPartOfMultiThreadedCode(ClassContext classContext)
    • hasEnclosingInstanceReference

      private static boolean hasEnclosingInstanceReference(org.apache.bcel.classfile.JavaClass javaClass)
      Returns whether javaClass is a non-static inner class that holds a reference to an enclosing instance. The compiler emits a synthetic this$0 (or this$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

      private static boolean isInstanceOfLock(@DottedClassName String className)
    • isFieldIndicatingMultiThreadedContainer

      private static boolean isFieldIndicatingMultiThreadedContainer(org.apache.bcel.classfile.Field field)
    • isFromAtomicPackage

      private static boolean isFromAtomicPackage(String signature)
    • isLocked

      public static boolean isLocked(org.apache.bcel.classfile.Method currentMethod, CFG currentCFG, LockDataflow currentLockDataFlow, int pc)
    • isNotThreadSafe

      public static boolean isNotThreadSafe(ClassContext classContext)
      Returns:
      true if the class is explicitly annotated with NotThreadSafe to document that it is not thread safe