Class ThreadSafeAnalysis
java.lang.Object
com.google.errorprone.bugpatterns.threadsafety.ThreadSafeAnalysis
Analyzes types for deep thread safety.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptioncheckForThreadSafety(Optional<ClassTree> tree, com.google.common.collect.ImmutableSet<String> threadSafeTypeParams, com.sun.tools.javac.code.Type.ClassType type) Check that an@ThreadSafe-annotated class:checkInvocation(com.sun.tools.javac.code.Type methodType, com.sun.tools.javac.code.Symbol symbol) com.google.common.collect.ImmutableSet<String> threadSafeTypeParametersInScope(com.sun.tools.javac.code.Symbol sym)
-
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<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)
-