Class MultiThreadedCodeIdentifierUtils


  • public class MultiThreadedCodeIdentifierUtils
    extends java.lang.Object
    Utility class with methods to identify multithreaded code
    • Constructor Detail

      • MultiThreadedCodeIdentifierUtils

        private MultiThreadedCodeIdentifierUtils()
    • Method Detail

      • 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
                                                             java.lang.String className,
                                                             java.lang.String methodName)
      • isInstanceOfLock

        private static boolean isInstanceOfLock​(@DottedClassName
                                                java.lang.String className)
      • isFieldIndicatingMultiThreadedContainer

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

        private static boolean isFromAtomicPackage​(java.lang.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