Class ThreadSafeAnalysis
java.lang.Object
com.google.errorprone.bugpatterns.threadsafety.ThreadSafeAnalysis
Analyzes types for deep thread safety.
-
Constructor Summary
ConstructorDescriptionThreadSafeAnalysis
(BugChecker bugChecker, VisitorState state, WellKnownThreadSafety wellKnownThreadSafety) -
Method Summary
Modifier and TypeMethodDescriptioncheckForThreadSafety
(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.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)
-
Constructor Details
-
ThreadSafeAnalysis
public ThreadSafeAnalysis(BugChecker bugChecker, VisitorState state, WellKnownThreadSafety wellKnownThreadSafety)
-
-
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.
-
threadSafeTypeParametersInScope
public com.google.common.collect.ImmutableSet<String> threadSafeTypeParametersInScope(com.sun.tools.javac.code.Symbol sym)
-