Class GuardedByBinder
java.lang.Object
com.google.errorprone.bugpatterns.threadsafety.GuardedByBinder
A binder from
@GuardedBy
annotations to GuardedByExpression
s.- Author:
- cushon@google.com (Liam Miller-Cushon)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
A context containing the information necessary to resolve aSymbol
from an AST node. -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional
<GuardedByExpression> bindExpression
(com.sun.tools.javac.tree.JCTree.JCExpression exp, VisitorState visitorState, GuardedByFlags flags) Creates aGuardedByExpression
from a bound AST node, or returnsOptional.empty()
if the AST node doesn't correspond to a 'simple' lock expression.static Optional
<GuardedByExpression> bindString
(String string, GuardedBySymbolResolver resolver, GuardedByFlags flags) Creates aGuardedByExpression
from a string, given the resolution context.
-
Method Details
-
bindExpression
public static Optional<GuardedByExpression> bindExpression(com.sun.tools.javac.tree.JCTree.JCExpression exp, VisitorState visitorState, GuardedByFlags flags) Creates aGuardedByExpression
from a bound AST node, or returnsOptional.empty()
if the AST node doesn't correspond to a 'simple' lock expression. -
bindString
public static Optional<GuardedByExpression> bindString(String string, GuardedBySymbolResolver resolver, GuardedByFlags flags) Creates aGuardedByExpression
from a string, given the resolution context.
-