Class ThreadSafeAnalysis

java.lang.Object
com.google.errorprone.bugpatterns.threadsafety.ThreadSafeAnalysis

public class ThreadSafeAnalysis extends Object
Analyzes types for deep thread safety.
  • Constructor Details

  • Method Details

    • checkInvocation

      public ThreadSafety.Violation checkInvocation(com.sun.tools.javac.code.Type methodType, com.sun.tools.javac.code.Symbol symbol)
    • checkForThreadSafety

      public ThreadSafety.Violation checkForThreadSafety(Optional<com.sun.source.tree.ClassTree> tree, com.google.common.collect.ImmutableSet<String> threadSafeTypeParams, com.sun.tools.javac.code.Type.ClassType type)
      Check that an @ThreadSafe-annotated class:
      • does not declare or inherit any fields which are not thread safe,
      • any threadsafe supertypes are instantiated with threadsafe type arguments as required by their containerOf spec, and
      • any enclosing instances are threadsafe.
      requiring supertypes to be annotated threadsafe would be too restrictive.
    • threadSafeTypeParametersInScope

      public com.google.common.collect.ImmutableSet<String> threadSafeTypeParametersInScope(com.sun.tools.javac.code.Symbol sym)