Uses of Interface
com.google.errorprone.matchers.Matcher

Packages that use Matcher
Package
Description
Checks added to the java compiler which detect common bug patterns.
 
Bug patterns related to Dagger.
A predicate DSL for matching javac AST nodes.
 
Utility code.
  • Uses of Matcher in com.google.errorprone.bugpatterns

    Modifier and Type
    Field
    Description
    static final Matcher<com.sun.source.tree.BinaryTree>
    BadShiftAmount.BINARY_TREE_MATCHER
     
    static final Matcher<com.sun.source.tree.ExpressionTree>
    CollectorShouldNotUseState.COLLECTOR_OF_CALL
     
    final Matcher<com.sun.source.tree.Tree>
    CollectorShouldNotUseState.containsAnonymousClassUsingState
     
    protected static final Matcher<com.sun.source.tree.Tree>
    AbstractMustBeClosedChecker.HAS_MUST_BE_CLOSED_ANNOTATION
    Matches trees annotated with MustBeClosed.
    static final Matcher<com.sun.source.tree.Tree>
    DeadException.MATCHER
     
    static final Matcher<com.sun.source.tree.ExpressionTree>
    ProtoBuilderReturnValueIgnored.MATCHER
     
    static final Matcher<com.sun.source.tree.ExpressionTree>
    StreamResourceLeak.MATCHER
     
    static final Matcher<com.sun.source.tree.Tree>
    PreferredInterfaceType.SHOULD_IGNORE
     
    Modifier and Type
    Method
    Description
    protected Matcher<? super com.sun.source.tree.MethodInvocationTree>
    AbstractPatternSyntaxChecker.getMatcherWithFlags()
     
    protected Matcher<? super com.sun.source.tree.MethodInvocationTree>
    AbstractPatternSyntaxChecker.getMatcherWithoutFlags()
     
    protected Matcher<com.sun.source.tree.MethodTree>
    JUnit4SetUpNotRun.methodMatcher()
     
    protected Matcher<com.sun.source.tree.MethodTree>
    JUnit4TearDownNotRun.methodMatcher()
     
    protected abstract Matcher<? super com.sun.source.tree.ExpressionTree>
    AbstractReturnValueIgnored.specializedMatcher()
    Match whatever additional conditions concrete subclasses want to match (a list of known side-effect-free methods, has a @CheckReturnValue annotation, etc.).
    Matcher<com.sun.source.tree.ExpressionTree>
    CheckReturnValue.specializedMatcher()
    Return a matcher for method invocations in which the method being called should be considered must-be-used.
    Matcher<com.sun.source.tree.ExpressionTree>
    FutureReturnValueIgnored.specializedMatcher()
     
    protected Matcher<? super com.sun.source.tree.ExpressionTree>
    IgnoredPureGetter.specializedMatcher()
     
    Matcher<? super com.sun.source.tree.ExpressionTree>
    ProtoBuilderReturnValueIgnored.specializedMatcher()
     
    Matcher<? super com.sun.source.tree.ExpressionTree>
    ReturnValueIgnored.specializedMatcher()
     
    Matcher<? super com.sun.source.tree.ExpressionTree>
    RxReturnValueIgnored.specializedMatcher()
     
    Methods in com.google.errorprone.bugpatterns with parameters of type Matcher
    Modifier and Type
    Method
    Description
    static AbstractMockChecker.TypeExtractor<com.sun.source.tree.MethodInvocationTree>
    AbstractMockChecker.extractClassArg(Matcher<com.sun.source.tree.MethodInvocationTree> m)
    Produces an extractor which, if the tree matches, extracts the type of the first argument whose type is Class (preserving its <T> type parameter, if it has one}.
    static AbstractMockChecker.TypeExtractor<com.sun.source.tree.MethodInvocationTree>
    AbstractMockChecker.extractFirstArg(Matcher<com.sun.source.tree.MethodInvocationTree> m)
    Produces an extractor which, if the tree matches, extracts the type of the first argument to the method invocation.
    static <T extends com.sun.source.tree.Tree>
    AbstractMockChecker.TypeExtractor<T>
    AbstractMockChecker.extractType(Matcher<T> m)
    Produces an extractor which, if the tree matches, extracts the type of that tree, as given by ASTHelpers.getType(Tree).
    protected <T extends com.sun.source.tree.Tree>
    Description
    AbstractBanUnsafeAPIChecker.matchHelper(T tree, VisitorState state, Matcher<T> matcher)
     
    protected Description
    AbstractMustBeClosedChecker.scanEntireMethodFor(Matcher<? super com.sun.source.tree.ExpressionTree> matcher, com.sun.source.tree.MethodTree tree, VisitorState state)
    Scans a method body for invocations matching matcher, emitting them as a single fix.
    StronglyType.Builder.setFactoryMatcher(Matcher<com.sun.source.tree.ExpressionTree> matcher)
    Set the matcher used to check if an expression is a factory creating a stronger type.
  • Uses of Matcher in com.google.errorprone.bugpatterns.android

    Modifier and Type
    Method
    Description
    Matcher<? super com.sun.source.tree.ExpressionTree>
    RectIntersectReturnValueIgnored.specializedMatcher()
     
  • Uses of Matcher in com.google.errorprone.bugpatterns.inject.dagger

    Modifier and Type
    Method
    Description
    static Matcher<com.sun.source.tree.Tree>
    DaggerAnnotations.isAnyModule()
     
  • Uses of Matcher in com.google.errorprone.matchers

    Modifier and Type
    Interface
    Description
    interface 
    MultiMatcher<T extends com.sun.source.tree.Tree,N extends com.sun.source.tree.Tree>
    An matcher that applies a single matcher across multiple tree nodes.
    Classes in com.google.errorprone.matchers that implement Matcher
    Modifier and Type
    Class
    Description
    class 
    AbstractTypeMatcher<T extends com.sun.source.tree.Tree>
    Base class for type matchers.
    class 
    Matches an annotation that does not have a particular argument, possibly because the default value is being used.
    class 
     
    class 
    AnnotationMatcher<T extends com.sun.source.tree.Tree>
    Matches if the given annotation matcher matches all of or any of the annotations on the tree node.
    class 
     
    class 
    Matches assert statements which have a condition expression matched by the given matcher.
    class 
    ChildMultiMatcher<T extends com.sun.source.tree.Tree,N extends com.sun.source.tree.Tree>
    A MultiMatcher that applies a matcher across multiple children of a single ancestor node.
    class 
    A matcher for compile-time-constant expressions.
    class 
    Matcher for a compound-assignment operator expression.
    class 
    Applies the given matcher to the constructor(s) of the given class.
    class 
    A matcher that recursively inspects a tree, applying the given matcher to all levels of each tree and returning true if any match is found.
    static class 
    Enclosing.Block<T extends com.sun.source.tree.Tree>
     
    static class 
    Enclosing.BlockOrCase<T extends com.sun.source.tree.Tree>
     
    static class 
    Enclosing.Class<T extends com.sun.source.tree.Tree>
     
    static class 
    Enclosing.Method<T extends com.sun.source.tree.Tree>
     
    class 
    Matches if the given matcher matches all of/any of the parameters to this method.
    class 
    Matches if the given matcher matches all of the identifiers under this syntax tree.
    final class 
    Matches expressions that can be statically determined to be non-null.
    class 
    IsSameType<T extends com.sun.source.tree.Tree>
    Matches an AST node if its erased type is the same as the given type, e.g.
    class 
    IsSubtypeOf<T extends com.sun.source.tree.Tree>
     
    class 
    Matches if the given matcher matches all of/any of the parameters to this method.
    class 
    Matches a method invocation based on a matcher for the method select (receiver + method identifier) and one for the arguments.
    class 
    Applies an Expression matcher to an argument of a MethodInvocation by position.
    class 
    A matcher for method visibility (public, private, protected, or default).
    class 
    Matches an expression based on the result of the nullness dataflow analysis.
    class 
    Matches a return statement whose returned expression is matched by the given matcher.
    class 
     
    class 
    Matches a throw statement whose thrown expression is matched by the given matcher.
    final class 
    Matches expressions that invoke or reference a non-void method or constructor and which do not use their return value and are not in a context where non-use of the return value is allowed.
    Modifier and Type
    Field
    Description
    static final Matcher<com.sun.source.tree.Tree>
    InjectMatchers.HAS_INJECT_ANNOTATION
     
    static final Matcher<com.sun.source.tree.MethodTree>
     
    static final Matcher<com.sun.source.tree.MethodTree>
     
    static final Matcher<com.sun.source.tree.ClassTree>
    JUnitMatchers.hasJUnit4TestCases
    Match a class which has one or more methods with a JUnit 4 @Test annotation.
    static final Matcher<com.sun.source.tree.Tree>
    InjectMatchers.INSIDE_GUICE_MODULE
     
    static final Matcher<com.sun.source.tree.AnnotationTree>
     
    static final Matcher<com.sun.source.tree.AnnotationTree>
     
    static final Matcher<com.sun.source.tree.AnnotationTree>
     
    static final Matcher<com.sun.source.tree.AnnotationTree>
    InjectMatchers.IS_BINDING_ANNOTATION
     
    static final Matcher<com.sun.source.tree.ClassTree>
    InjectMatchers.IS_DAGGER_COMPONENT
     
    static final Matcher<com.sun.source.tree.ClassTree>
     
    static final Matcher<com.sun.source.tree.Tree>
    Matchers.IS_INTERFACE
     
    static final Matcher<com.sun.source.tree.AnnotationTree>
    InjectMatchers.IS_SCOPING_ANNOTATION
     
    static final Matcher<com.sun.source.tree.ClassTree>
    Matches classes which have attributes of both JUnit 3 and 4 classes.
    static final Matcher<com.sun.source.tree.ClassTree>
    Match a class which appears to be missing a @RunWith annotation.
    static final Matcher<com.sun.source.tree.MethodTree>
    JUnitMatchers.isJunit3TestCase
    Match a method which appears to be a JUnit 3 test case.
    static final Matcher<com.sun.source.tree.ClassTree>
    JUnitMatchers.isJUnit3TestClass
    Match a class which appears to be a JUnit 3 test class.
    static final Matcher<com.sun.source.tree.ClassTree>
    JUnitMatchers.isJUnit4TestClass
    Matches classes which have attributes of only JUnit4 test classes.
    static final Matcher<com.sun.source.tree.ClassTree>
    JUnitMatchers.isTestCaseDescendant
    Matches a class that inherits from TestCase.
    static final Matcher<com.sun.source.tree.MethodTree>
    JUnitMatchers.looksLikeJUnit3SetUp
    Match a method which appears to be a JUnit 3 setUp method
    static final Matcher<com.sun.source.tree.MethodTree>
    Match a method which appears to be a JUnit 3 tearDown method
    static final Matcher<com.sun.source.tree.MethodTree>
    JUnitMatchers.looksLikeJUnit4After
    Matches a method which appears to be a JUnit4 @After method.
    static final Matcher<com.sun.source.tree.MethodTree>
    JUnitMatchers.looksLikeJUnit4Before
    Matches a method which appears to be a JUnit4 @Before method.
    static final Matcher<com.sun.source.tree.MethodTree>
    Matchers.MAIN_METHOD
     
    protected final Matcher<T>
    Enclosing.EnclosingMatcher.matcher
     
    protected final Matcher<T>
    Enclosing.EnclosingMatcher.matcher
     
    protected final Matcher<T>
    Enclosing.EnclosingMatcher.matcher
     
    protected final Matcher<N>
    ChildMultiMatcher.nodeMatcher
    The matcher to apply to the subnodes in question.
    static final Matcher<com.sun.source.tree.MethodTree>
    Method signature of serialization methods.
    static final Matcher<com.sun.source.tree.MethodTree>
    JUnitMatchers.TEST_CASE
    Matches a JUnit 3 or 4 test case.
    static final Matcher<com.sun.source.tree.MethodInvocationTree>
    WaitMatchers.waitMethod
    Matches any wait/await method.
    static final Matcher<com.sun.source.tree.MethodInvocationTree>
    Matches wait/await methods that have a timeout.
    static final Matcher<com.sun.source.tree.MethodTree>
    JUnitMatchers.wouldRunInJUnit4
    Matches a method annotated with @Test but not @Ignore.
    Modifier and Type
    Method
    Description
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.allOf(Matcher<? super T>... matchers)
    Compose several matchers together, such that the composite matches an AST node iff all the given matchers do.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.allOf(Iterable<? extends Matcher<? super T>> matchers)
    Compose several matchers together, such that the composite matches an AST node iff all the given matchers do.
    static Matcher<com.sun.source.tree.ExpressionTree>
    FieldMatchers.anyFieldInClass(String className)
     
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.anyOf(Matcher<? super T>... matchers)
     
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.anyOf(Iterable<? extends Matcher<? super T>> matchers)
    Compose several matchers together, such that the composite matches an AST node if any of the given matchers do.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.anything()
    A matcher that matches any AST node.
    static Matcher<com.sun.source.tree.MethodInvocationTree>
    Matchers.argument(int position, Matcher<com.sun.source.tree.ExpressionTree> argumentMatcher)
     
    static Matcher<com.sun.source.tree.MethodInvocationTree>
    Matchers.argumentCount(int argumentCount)
     
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matches calls to the method org.junit.Assert#assertEquals and corresponding methods in JUnit 3.x.
    static Matcher<com.sun.source.tree.AssertTree>
    Matchers.assertionWithCondition(Matcher<com.sun.source.tree.ExpressionTree> conditionMatcher)
    Matches an assertion AST node if the given matcher matches its condition.
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matches calls to the method org.junit.Assert#assertNotEquals and corresponding methods in JUnit 3.x.
    static Matcher<com.sun.source.tree.StatementTree>
    Matchers.assertStatement(Matcher<com.sun.source.tree.ExpressionTree> conditionMatcher)
    Matches an assert statement where the condition is matched by the passed conditionMatcher.
    static Matcher<com.sun.source.tree.AssignmentTree>
    Matchers.assignment(Matcher<com.sun.source.tree.ExpressionTree> variableMatcher, Matcher<? super com.sun.source.tree.ExpressionTree> expressionMatcher)
    Matches an assignment operator AST node if both of the given matchers match.
    static Matcher<com.sun.source.tree.BinaryTree>
    Matchers.binaryTree(Matcher<com.sun.source.tree.ExpressionTree> matcher1, Matcher<com.sun.source.tree.ExpressionTree> matcher2)
    Matches a binary tree if the given matchers match the operands in either order.
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matchers.booleanConstant(boolean value)
    Matches the boolean constant (Boolean.TRUE or Boolean.FALSE) corresponding to the given value.
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matchers.booleanLiteral(boolean value)
     
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matchers.classLiteral(Matcher<? super com.sun.source.tree.ExpressionTree> classMatcher)
     
    static Matcher<com.sun.source.tree.MethodTree>
    Matches compareTo method declaration.
    static Matcher<com.sun.source.tree.MethodTree>
    Matchers.constructorOfClass(String className)
    Matches a constructor declaration in a specific enclosing class.
    static Matcher<com.sun.source.tree.Tree>
    Matchers.contains(Matcher<com.sun.source.tree.Tree> treeMatcher)
    Applies the given matcher recursively to all descendants of an AST node, and matches if any matching descendant node is found.
    static <T extends com.sun.source.tree.Tree, V extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.contains(Class<? extends V> clazz, Matcher<? super V> treeMatcher)
    Applies the given matcher recursively to all descendants of an AST node, and matches if any matching descendant node is found.
    static Matcher<com.sun.source.tree.StatementTree>
    Matches a continue statement.
    static Matcher<com.sun.source.tree.AnnotationTree>
    Matchers.doesNotHaveArgument(String argumentName)
    Matches an Annotation AST node if an argument to the annotation does not exist.
    static Matcher<com.sun.source.tree.Tree>
    Matchers.enclosingNode(Matcher<com.sun.source.tree.Tree> matcher)
    Matches an AST node that is enclosed by some node that matches the given matcher.
    static Matcher<com.sun.source.tree.EnhancedForLoopTree>
    Matchers.enhancedForLoop(Matcher<com.sun.source.tree.VariableTree> variableMatcher, Matcher<com.sun.source.tree.ExpressionTree> expressionMatcher, Matcher<com.sun.source.tree.StatementTree> statementMatcher)
    Matches an enhanced for loop if all the given matchers match.
    static Matcher<com.sun.source.tree.MethodTree>
    Matches Object.equals(java.lang.Object) method declaration.
    static Matcher<com.sun.source.tree.StatementTree>
    Matchers.expressionStatement(Matcher<com.sun.source.tree.ExpressionTree> matcher)
    Matches an ExpressionStatementTree based on its ExpressionTree.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.hasAnnotation(Class<? extends Annotation> inputClass)
    Determines whether an expression has an annotation of the given class.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.hasAnnotation(String annotationClass)
    Determines whether an expression has an annotation of the given type.
    static Matcher<com.sun.source.tree.Tree>
    Matchers.hasAnnotation(TypeMirror annotationMirror)
    Determines if an expression has an annotation referred to by the given mirror.
    static Matcher<com.sun.source.tree.MethodTree>
    Matchers.hasAnnotationOnAnyOverriddenMethod(String annotationClass)
    Matches if a method or any method it overrides has an annotation of the given type.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.hasAnnotationWithSimpleName(String simpleName)
    Determines whether an expression has an annotation with the given simple name.
    static Matcher<com.sun.source.tree.Tree>
    Matchers.hasAnyAnnotation(Class<? extends Annotation>... annotations)
     
    static Matcher<com.sun.source.tree.Tree>
    Matchers.hasAnyAnnotation(List<? extends TypeMirror> mirrors)
     
    static Matcher<com.sun.source.tree.AnnotationTree>
    Matchers.hasArgumentWithValue(String argumentName, Matcher<com.sun.source.tree.ExpressionTree> valueMatcher)
    Matches an Annotation AST node if the argument to the annotation with the given name has a value which matches the given matcher.
    static Matcher<com.sun.source.tree.MethodTree>
    Matches hashCode method declaration.
    static Matcher<com.sun.source.tree.Tree>
    Matchers.hasIdentifier(Matcher<com.sun.source.tree.IdentifierTree> nodeMatcher)
    Matches any AST that contains an identifier with a certain property.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    InjectMatchers.hasInjectAnnotation()
     
    static Matcher<com.sun.source.tree.ClassTree>
    Matchers.hasMethod(Matcher<com.sun.source.tree.MethodTree> methodMatcher)
    Matches a class in which at least one method matches the given methodMatcher.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.hasModifier(Modifier modifier)
    Returns true if the Tree node has the expected Modifier.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    InjectMatchers.hasProvidesAnnotation()
     
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matchers.ignoreParens(Matcher<com.sun.source.tree.ExpressionTree> innerMatcher)
    Ignores any number of parenthesis wrapping an expression and then applies the passed matcher to that expression.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.inLoop()
    Matches if the given tree is inside a loop.
    static Matcher<com.sun.source.tree.ExpressionTree>
    CompileTimeConstantExpressionMatcher.instance()
     
    static <T extends com.sun.source.tree.ExpressionTree>
    Matcher<T>
    Matches calls to the method Object.equals(Object) or any override of that method.
    static Matcher<com.sun.source.tree.ExpressionTree>
    FieldMatchers.instanceField(String className, String fieldName)
     
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matches calls to the method Object.hashCode() or any override of that method.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.inSynchronized()
    Matches if this Tree is enclosed by either a synchronized block or a synchronized method.
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matchers.intLiteral(int value)
     
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.isArrayType()
    Matches an AST node if its type is an array type.
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matches an AST node if its type is a boxed primitive type.
    static Matcher<com.sun.source.tree.ClassTree>
    Matches any node that is directly an implementation, but not extension, of the given Class.
    static Matcher<com.sun.source.tree.ClassTree>
    Matchers.isEnum()
    Matches if a ClassTree is an enum declaration.
    static Matcher<com.sun.source.tree.ClassTree>
    Matchers.isExtensionOf(String clazz)
    Matches any node that is a direct extension of the given class.
    static Matcher<com.sun.source.tree.VariableTree>
    Matchers.isField()
    Matches if a VariableTree is a field declaration, as opposed to a local variable, enum constant, parameter to a method, etc.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.isInstance(Class<?> klass)
    Matches if an AST node is an instance of the given class.
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matchers.isInstanceField()
    Matches an AST node that represents a non-static field.
    static Matcher<com.sun.source.tree.ExpressionTree>
    JUnitMatchers.isJUnit4TestRunnerOfType(Iterable<String> runnerTypes)
    Matches an argument of type Class<T>, where T is a subtype of one of the test runners listed in the TEST_RUNNERS field.
    static Matcher<com.sun.source.tree.StatementTree>
    Matches a statement AST node if the statement is the last statement in the block.
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matchers.isNonNull()
    Deprecated.
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matches if the expression is provably non-null.
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matchers.isNull()
    Deprecated.
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matches if the expression is provably null.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matches an AST node if its type is a primitive array type.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matches an AST node if its type is a primitive type, or a boxed version of a primitive type.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matches an AST node if its type is either a primitive type or a void type.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.isPrimitiveType()
    Matches an AST node if its type is a primitive type.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.isSame(com.sun.source.tree.Tree t)
    Matches an AST node which is the same object reference as the given node.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.isSameType(Supplier<com.sun.tools.javac.code.Type> type)
    Matches an AST node if it has the same erased type as the given type.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.isSameType(Class<?> clazz)
    Matches an AST node if it has the same erased type as the given class.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.isSameType(String typeString)
    Matches an AST node if it has the same erased type as the given type.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.isStatic()
    Matches an AST node that is static.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.isSubtypeOf(Supplier<com.sun.tools.javac.code.Type> type)
    Matches an AST node if its type is a subtype of the given type.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.isSubtypeOf(Class<?> clazz)
    Matches an AST node if its type is a subtype of the given type.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.isSubtypeOf(String typeStr)
    Matches an AST node if its type is a subtype of the given type.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.isTransient()
    Matches an AST node that is transient.
    static Matcher<com.sun.source.tree.AnnotationTree>
    Matchers.isType(String annotationClassName)
     
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matchers.isVariable()
    Matches an AST node that represents a local variable or parameter.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.isVoidType()
    Matches an AST node if its type is a void type.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.kindAnyOf(Set<com.sun.source.tree.Tree.Kind> kinds)
    Matches an AST node of a given kind, for example, an Annotation or a switch block.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.kindIs(com.sun.source.tree.Tree.Kind kind)
    Matches an AST node of a given kind, for example, an Annotation or a switch block.
    static Matcher<com.sun.source.tree.StatementTree>
    Matchers.matchExpressionReturn(Matcher<com.sun.source.tree.ExpressionTree> expressionTreeMatcher)
    Matches the Tree if it returns an expression matching expressionTreeMatcher.
    static Matcher<com.sun.source.tree.BlockTree>
    Matchers.matchSingleStatementBlock(Matcher<com.sun.source.tree.StatementTree> statementMatcher)
    Matches a BlockTree if it single statement block with statement matching statementMatcher.
    static Matcher<com.sun.source.tree.MethodTree>
    Matchers.methodHasArity(int arity)
    Matches if the method accepts the given number of arguments.
    static Matcher<com.sun.source.tree.MethodTree>
    Matches an AST node that represents a method declaration with no parameters.
    static Matcher<com.sun.source.tree.MethodTree>
    Matchers.methodHasParameters(Matcher<com.sun.source.tree.VariableTree>... variableMatcher)
    Matches an AST node that represents a method declaration, based on the list of variableMatchers.
    static Matcher<com.sun.source.tree.MethodTree>
    Matchers.methodHasParameters(List<Matcher<com.sun.source.tree.VariableTree>> variableMatcher)
    Matches an AST node that represents a method declaration, based on the list of variableMatchers.
    static Matcher<com.sun.source.tree.MethodTree>
     
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matchers.methodInvocation(Matcher<com.sun.source.tree.ExpressionTree> methodSelectMatcher)
    Matches an AST node if it is a method invocation and the method select matches methodSelectMatcher.
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matchers.methodInvocation(Matcher<com.sun.source.tree.ExpressionTree> methodSelectMatcher, ChildMultiMatcher.MatchType matchType, Matcher<com.sun.source.tree.ExpressionTree> methodArgumentMatcher)
    Matches an AST node if it is a method invocation and the given matchers match.
    static Matcher<com.sun.source.tree.MethodTree>
     
    static Matcher<com.sun.source.tree.MethodTree>
    Matchers.methodIsNamed(String methodName)
    Match a method declaration with a specific name.
    static Matcher<com.sun.source.tree.MethodTree>
    Matchers.methodNameStartsWith(String prefix)
    Match a method declaration that starts with a given string.
    static Matcher<com.sun.source.tree.MethodTree>
    Matchers.methodReturns(Matcher<? super com.sun.source.tree.Tree> returnTypeMatcher)
     
    static Matcher<com.sun.source.tree.MethodTree>
    Matchers.methodReturns(Supplier<com.sun.tools.javac.code.Type> returnType)
     
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matches a method invocation that is known to never return null.
    static Matcher<com.sun.source.tree.MethodTree>
    Match a method that returns a non-primitive type.
    static Matcher<com.sun.source.tree.MethodTree>
    Matchers.methodWithClassAndName(String className, String methodName)
    Match a method declaration with a specific enclosing class and method name.
    static Matcher<com.sun.source.tree.ClassTree>
    Matchers.nestingKind(NestingKind kind)
    Matches an class based on whether it is nested in another class or method.
    static <T extends com.sun.source.tree.StatementTree>
    Matcher<T>
    Matchers.nextStatement(Matcher<com.sun.source.tree.StatementTree> matcher)
    Matches a statement AST node if the following statement in the enclosing block matches the given matcher.
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matchers.nonNullLiteral()
    Matches an AST node if it is a literal other than null.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.not(Matcher<T> matcher)
    Matches an AST node iff it does not match the given matcher.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.nothing()
    A matcher that matches no AST node.
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matchers.nullLiteral()
    Matches an AST node if it is a null literal.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.packageMatches(Predicate<String> predicate)
    Matches an AST node whose compilation unit's package name matches the given predicate.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.packageMatches(Pattern pattern)
    Matches an AST node whose compilation unit's package name matches the given pattern.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.packageStartsWith(String prefix)
    Matches an AST node whose compilation unit starts with this prefix.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.parentNode(Matcher<com.sun.source.tree.Tree> treeMatcher)
    Matches an AST node if its parent node is matched by the given matcher.
    static <T extends com.sun.source.tree.StatementTree>
    Matcher<T>
    Matchers.previousStatement(Matcher<com.sun.source.tree.StatementTree> matcher)
    Matches a statement AST node if the previous statement in the enclosing block matches the given matcher.
    static Matcher<com.sun.source.tree.MethodInvocationTree>
    Matchers.receiverOfInvocation(Matcher<com.sun.source.tree.ExpressionTree> expressionTreeMatcher)
     
    static Matcher<? super com.sun.source.tree.MethodInvocationTree>
    Matchers.receiverSameAsArgument(int argNum)
    Matches when the receiver of an instance method is the same reference as a particular argument to the method.
    static Matcher<com.sun.source.tree.StatementTree>
    Matchers.returnStatement(Matcher<? super com.sun.source.tree.ExpressionTree> returnedMatcher)
    Matches a return statement where the returned expression is matched by the passed returnedMatcher.
    static Matcher<? super com.sun.source.tree.MethodInvocationTree>
    Matchers.sameArgument(int index1, int index2)
    Matches a MethodInvocation when the arguments at the two given indices are both the same variable, as determined by ASTHelpers.sameVariable(com.sun.source.tree.ExpressionTree, com.sun.source.tree.ExpressionTree).
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matchers.sameVariable(com.sun.source.tree.ExpressionTree expr)
    Matches if this ExpressionTree refers to the same variable as the one passed into the matcher.
    static Matcher<com.sun.source.tree.MethodTree>
    Matchers.singleStatementReturnMatcher(Matcher<com.sun.source.tree.ExpressionTree> expressionTreeMatcher)
    Returns a matcher for MethodTree whose implementation contains a single return statement with expression matching the passed expressionTreeMatcher.
    static <T extends com.sun.source.tree.ExpressionTree>
    Matcher<T>
    Matches an invocation of a recognized static object equality method such as Objects.equals(java.lang.Object, java.lang.Object).
    static Matcher<com.sun.source.tree.ExpressionTree>
    FieldMatchers.staticField(String className, String fieldName)
     
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matches an AST node which is an expression yielding the indicated static field access.
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matchers.stringLiteral(String value)
    Matches a Literal AST node if it is a string literal with the given value.
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matchers.stringLiteral(Pattern pattern)
    Matches a Literal AST node if it is a string literal which matches the given Pattern.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.symbolHasAnnotation(Class<? extends Annotation> inputClass)
    Determines whether an expression refers to a symbol that has an annotation of the given type.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.symbolHasAnnotation(String annotationClass)
    Determines whether an expression refers to a symbol that has an annotation of the given type.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.symbolMatcher(BiPredicate<com.sun.tools.javac.code.Symbol,VisitorState> pred)
    Match a Tree based solely on the Symbol produced by ASTHelpers.getSymbol(Tree).
    static Matcher<com.sun.source.tree.StatementTree>
    Matchers.throwStatement(Matcher<? super com.sun.source.tree.ExpressionTree> thrownMatcher)
    Matches a throw statement where the thrown item is matched by the passed thrownMatcher.
    static Matcher<com.sun.source.tree.MethodTree>
    Matches Object.toString() method declaration.
    static <S extends T, T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.toType(Class<S> type, Matcher<? super S> matcher)
    Converts the given matcher to one that can be applied to any tree but is only executed when run on a tree of type and returns false for all other tree types.
    static Matcher<com.sun.source.tree.TypeCastTree>
    Matchers.typeCast(Matcher<com.sun.source.tree.Tree> typeMatcher, Matcher<com.sun.source.tree.ExpressionTree> expressionMatcher)
    Matches a type cast AST node if both of the given matchers match.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Match a Tree based solely on the type produced by ASTHelpers.getType(Tree).
    static Matcher<com.sun.source.tree.VariableTree>
    Matchers.variableInitializer(Matcher<com.sun.source.tree.ExpressionTree> expressionTreeMatcher)
    Matches on the initializer of a VariableTree AST node.
    static Matcher<com.sun.source.tree.VariableTree>
    Matchers.variableType(Matcher<com.sun.source.tree.Tree> treeMatcher)
    Matches on the type of a VariableTree AST node.
    Methods in com.google.errorprone.matchers with parameters of type Matcher
    Modifier and Type
    Method
    Description
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.allOf(Matcher<? super T>... matchers)
    Compose several matchers together, such that the composite matches an AST node iff all the given matchers do.
    static <T extends com.sun.source.tree.Tree>
    MultiMatcher<T,com.sun.source.tree.AnnotationTree>
    Matchers.annotations(ChildMultiMatcher.MatchType matchType, Matcher<com.sun.source.tree.AnnotationTree> annotationMatcher)
    Matches if the given annotation matcher matches all of or any of the annotations on this tree node.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.anyOf(Matcher<? super T>... matchers)
     
    static Matcher<com.sun.source.tree.MethodInvocationTree>
    Matchers.argument(int position, Matcher<com.sun.source.tree.ExpressionTree> argumentMatcher)
     
    static Matcher<com.sun.source.tree.AssertTree>
    Matchers.assertionWithCondition(Matcher<com.sun.source.tree.ExpressionTree> conditionMatcher)
    Matches an assertion AST node if the given matcher matches its condition.
    static Matcher<com.sun.source.tree.StatementTree>
    Matchers.assertStatement(Matcher<com.sun.source.tree.ExpressionTree> conditionMatcher)
    Matches an assert statement where the condition is matched by the passed conditionMatcher.
    static Matcher<com.sun.source.tree.AssignmentTree>
    Matchers.assignment(Matcher<com.sun.source.tree.ExpressionTree> variableMatcher, Matcher<? super com.sun.source.tree.ExpressionTree> expressionMatcher)
    Matches an assignment operator AST node if both of the given matchers match.
    static Matcher<com.sun.source.tree.BinaryTree>
    Matchers.binaryTree(Matcher<com.sun.source.tree.ExpressionTree> matcher1, Matcher<com.sun.source.tree.ExpressionTree> matcher2)
    Matches a binary tree if the given matchers match the operands in either order.
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matchers.classLiteral(Matcher<? super com.sun.source.tree.ExpressionTree> classMatcher)
     
    Matchers.compoundAssignment(com.sun.source.tree.Tree.Kind operator, Matcher<com.sun.source.tree.ExpressionTree> leftOperandMatcher, Matcher<com.sun.source.tree.ExpressionTree> rightOperandMatcher)
    Matches a compound assignment operator AST node which matches a given left-operand matcher, a given right-operand matcher, and a specific compound assignment operator.
    Matchers.compoundAssignment(Set<com.sun.source.tree.Tree.Kind> operators, Matcher<com.sun.source.tree.ExpressionTree> receiverMatcher, Matcher<com.sun.source.tree.ExpressionTree> expressionMatcher)
    Matches a compound assignment operator AST node which matches a given left-operand matcher, a given right-operand matcher, and is one of a set of compound assignment operators.
    static MultiMatcher<com.sun.source.tree.ClassTree,com.sun.source.tree.MethodTree>
    Matchers.constructor(ChildMultiMatcher.MatchType matchType, Matcher<com.sun.source.tree.MethodTree> constructorMatcher)
    Matches a class in which any of/all of its constructors match the given constructorMatcher.
    static Matcher<com.sun.source.tree.Tree>
    Matchers.contains(Matcher<com.sun.source.tree.Tree> treeMatcher)
    Applies the given matcher recursively to all descendants of an AST node, and matches if any matching descendant node is found.
    static <T extends com.sun.source.tree.Tree, V extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.contains(Class<? extends V> clazz, Matcher<? super V> treeMatcher)
    Applies the given matcher recursively to all descendants of an AST node, and matches if any matching descendant node is found.
    static <T extends com.sun.source.tree.Tree>
    Enclosing.Block<T>
    Matchers.enclosingBlock(Matcher<com.sun.source.tree.BlockTree> matcher)
    Matches an AST node which is enclosed by a block node that matches the given matcher.
    static <T extends com.sun.source.tree.Tree>
    Enclosing.Class<T>
    Matchers.enclosingClass(Matcher<com.sun.source.tree.ClassTree> matcher)
    Matches an AST node which is enclosed by a class node that matches the given matcher.
    static <T extends com.sun.source.tree.Tree>
    Enclosing.Method<T>
    Matchers.enclosingMethod(Matcher<com.sun.source.tree.MethodTree> matcher)
    Matches an AST node which is enclosed by a method node that matches the given matcher.
    static Matcher<com.sun.source.tree.Tree>
    Matchers.enclosingNode(Matcher<com.sun.source.tree.Tree> matcher)
    Matches an AST node that is enclosed by some node that matches the given matcher.
    static Matcher<com.sun.source.tree.EnhancedForLoopTree>
    Matchers.enhancedForLoop(Matcher<com.sun.source.tree.VariableTree> variableMatcher, Matcher<com.sun.source.tree.ExpressionTree> expressionMatcher, Matcher<com.sun.source.tree.StatementTree> statementMatcher)
    Matches an enhanced for loop if all the given matchers match.
    static Matcher<com.sun.source.tree.StatementTree>
    Matchers.expressionStatement(Matcher<com.sun.source.tree.ExpressionTree> matcher)
    Matches an ExpressionStatementTree based on its ExpressionTree.
    static MultiMatcher<com.sun.source.tree.MethodInvocationTree,com.sun.source.tree.ExpressionTree>
    Matchers.hasArguments(ChildMultiMatcher.MatchType matchType, Matcher<com.sun.source.tree.ExpressionTree> argumentMatcher)
    Matches if the given matcher matches all of/any of the arguments to this method invocation.
    static Matcher<com.sun.source.tree.AnnotationTree>
    Matchers.hasArgumentWithValue(String argumentName, Matcher<com.sun.source.tree.ExpressionTree> valueMatcher)
    Matches an Annotation AST node if the argument to the annotation with the given name has a value which matches the given matcher.
    static Matcher<com.sun.source.tree.Tree>
    Matchers.hasIdentifier(Matcher<com.sun.source.tree.IdentifierTree> nodeMatcher)
    Matches any AST that contains an identifier with a certain property.
    static Matcher<com.sun.source.tree.ClassTree>
    Matchers.hasMethod(Matcher<com.sun.source.tree.MethodTree> methodMatcher)
    Matches a class in which at least one method matches the given methodMatcher.
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matchers.ignoreParens(Matcher<com.sun.source.tree.ExpressionTree> innerMatcher)
    Ignores any number of parenthesis wrapping an expression and then applies the passed matcher to that expression.
    static Matcher<com.sun.source.tree.StatementTree>
    Matchers.matchExpressionReturn(Matcher<com.sun.source.tree.ExpressionTree> expressionTreeMatcher)
    Matches the Tree if it returns an expression matching expressionTreeMatcher.
    static Matcher<com.sun.source.tree.BlockTree>
    Matchers.matchSingleStatementBlock(Matcher<com.sun.source.tree.StatementTree> statementMatcher)
    Matches a BlockTree if it single statement block with statement matching statementMatcher.
    static MultiMatcher<com.sun.source.tree.MethodTree,com.sun.source.tree.VariableTree>
    Matchers.methodHasParameters(ChildMultiMatcher.MatchType matchType, Matcher<com.sun.source.tree.VariableTree> parameterMatcher)
    Matches if the given matcher matches all of/any of the parameters to this method.
    static Matcher<com.sun.source.tree.MethodTree>
    Matchers.methodHasParameters(Matcher<com.sun.source.tree.VariableTree>... variableMatcher)
    Matches an AST node that represents a method declaration, based on the list of variableMatchers.
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matchers.methodInvocation(Matcher<com.sun.source.tree.ExpressionTree> methodSelectMatcher)
    Matches an AST node if it is a method invocation and the method select matches methodSelectMatcher.
    static Matcher<com.sun.source.tree.ExpressionTree>
    Matchers.methodInvocation(Matcher<com.sun.source.tree.ExpressionTree> methodSelectMatcher, ChildMultiMatcher.MatchType matchType, Matcher<com.sun.source.tree.ExpressionTree> methodArgumentMatcher)
    Matches an AST node if it is a method invocation and the given matchers match.
    static Matcher<com.sun.source.tree.MethodTree>
    Matchers.methodReturns(Matcher<? super com.sun.source.tree.Tree> returnTypeMatcher)
     
    static <T extends com.sun.source.tree.StatementTree>
    Matcher<T>
    Matchers.nextStatement(Matcher<com.sun.source.tree.StatementTree> matcher)
    Matches a statement AST node if the following statement in the enclosing block matches the given matcher.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.not(Matcher<T> matcher)
    Matches an AST node iff it does not match the given matcher.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.parentNode(Matcher<com.sun.source.tree.Tree> treeMatcher)
    Matches an AST node if its parent node is matched by the given matcher.
    static <T extends com.sun.source.tree.StatementTree>
    Matcher<T>
    Matchers.previousStatement(Matcher<com.sun.source.tree.StatementTree> matcher)
    Matches a statement AST node if the previous statement in the enclosing block matches the given matcher.
    static Matcher<com.sun.source.tree.MethodInvocationTree>
    Matchers.receiverOfInvocation(Matcher<com.sun.source.tree.ExpressionTree> expressionTreeMatcher)
     
    static Matcher<com.sun.source.tree.StatementTree>
    Matchers.returnStatement(Matcher<? super com.sun.source.tree.ExpressionTree> returnedMatcher)
    Matches a return statement where the returned expression is matched by the passed returnedMatcher.
    static Matcher<com.sun.source.tree.MethodTree>
    Matchers.singleStatementReturnMatcher(Matcher<com.sun.source.tree.ExpressionTree> expressionTreeMatcher)
    Returns a matcher for MethodTree whose implementation contains a single return statement with expression matching the passed expressionTreeMatcher.
    static Matcher<com.sun.source.tree.StatementTree>
    Matchers.throwStatement(Matcher<? super com.sun.source.tree.ExpressionTree> thrownMatcher)
    Matches a throw statement where the thrown item is matched by the passed thrownMatcher.
    static <S extends T, T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.toType(Class<S> type, Matcher<? super S> matcher)
    Converts the given matcher to one that can be applied to any tree but is only executed when run on a tree of type and returns false for all other tree types.
    static Matcher<com.sun.source.tree.TypeCastTree>
    Matchers.typeCast(Matcher<com.sun.source.tree.Tree> typeMatcher, Matcher<com.sun.source.tree.ExpressionTree> expressionMatcher)
    Matches a type cast AST node if both of the given matchers match.
    static Matcher<com.sun.source.tree.VariableTree>
    Matchers.variableInitializer(Matcher<com.sun.source.tree.ExpressionTree> expressionTreeMatcher)
    Matches on the initializer of a VariableTree AST node.
    static Matcher<com.sun.source.tree.VariableTree>
    Matchers.variableType(Matcher<com.sun.source.tree.Tree> treeMatcher)
    Matches on the type of a VariableTree AST node.
    Method parameters in com.google.errorprone.matchers with type arguments of type Matcher
    Modifier and Type
    Method
    Description
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.allOf(Iterable<? extends Matcher<? super T>> matchers)
    Compose several matchers together, such that the composite matches an AST node iff all the given matchers do.
    static <T extends com.sun.source.tree.Tree>
    Matcher<T>
    Matchers.anyOf(Iterable<? extends Matcher<? super T>> matchers)
    Compose several matchers together, such that the composite matches an AST node if any of the given matchers do.
    static Matcher<com.sun.source.tree.MethodTree>
    Matchers.methodHasParameters(List<Matcher<com.sun.source.tree.VariableTree>> variableMatcher)
    Matches an AST node that represents a method declaration, based on the list of variableMatchers.
    Constructors in com.google.errorprone.matchers with parameters of type Matcher
    Modifier
    Constructor
    Description
     
    AnnotationHasArgumentWithValue(String element, Matcher<com.sun.source.tree.ExpressionTree> valueMatcher)
     
     
    AnnotationMatcher(ChildMultiMatcher.MatchType matchType, Matcher<com.sun.source.tree.AnnotationTree> nodeMatcher)
     
     
    Asserts(Matcher<com.sun.source.tree.ExpressionTree> expressionMatcher)
     
     
    Block(Matcher<com.sun.source.tree.BlockTree> matcher)
     
     
    BlockOrCase(Matcher<com.sun.source.tree.BlockTree> blockTreeMatcher, Matcher<com.sun.source.tree.CaseTree> caseTreeMatcher)
     
     
     
     
    Class(Matcher<com.sun.source.tree.ClassTree> matcher)
     
     
    CompoundAssignment(Set<com.sun.source.tree.Tree.Kind> operators, Matcher<com.sun.source.tree.ExpressionTree> receiverMatcher, Matcher<com.sun.source.tree.ExpressionTree> expressionMatcher)
    Creates a new compound-assignment operator matcher, which matches a compound assignment expression with one of a set of operators and whose receiver and expression match the given matchers.
     
    ConstructorOfClass(ChildMultiMatcher.MatchType matchType, Matcher<com.sun.source.tree.MethodTree> nodeMatcher)
     
     
    Contains(Matcher<com.sun.source.tree.Tree> matcher)
     
     
    HasArguments(ChildMultiMatcher.MatchType matchType, Matcher<com.sun.source.tree.ExpressionTree> nodeMatcher)
     
     
    HasIdentifier(Matcher<com.sun.source.tree.IdentifierTree> nodeMatcher)
     
     
    Method(Matcher<com.sun.source.tree.MethodTree> matcher)
     
     
    MethodHasParameters(ChildMultiMatcher.MatchType matchType, Matcher<com.sun.source.tree.VariableTree> nodeMatcher)
     
     
    MethodInvocation(Matcher<com.sun.source.tree.ExpressionTree> methodSelectMatcher, ChildMultiMatcher.MatchType matchType, Matcher<com.sun.source.tree.ExpressionTree> methodArgumentMatcher)
    Creates a new matcher for method invocations based on a method select and an argument matcher.
     
    MethodInvocationArgument(int position, Matcher<com.sun.source.tree.ExpressionTree> argumentMatcher)
     
     
    Returns(Matcher<? super com.sun.source.tree.ExpressionTree> returnedMatcher)
    New matcher for a return statement where the returned expression is matched by the passed returnedMatcher.
     
    Throws(Matcher<? super com.sun.source.tree.ExpressionTree> thrownMatcher)
    New matcher for a throw statement where the thrown item is matched by the passed thrownMatcher.
  • Uses of Matcher in com.google.errorprone.matchers.method

    Modifier and Type
    Interface
    Description
    static interface 
    Deprecated.
    use Matcher<ExpressionTree> instead of referring directly to this type.
    static interface 
    Deprecated.
    use Matcher<ExpressionTree> instead of referring directly to this type.
    static interface 
    Deprecated.
    use Matcher<ExpressionTree> instead of referring directly to this type.
    static interface 
    Deprecated.
    use Matcher<ExpressionTree> instead of referring directly to this type.
    static interface 
    Deprecated.
    use Matcher<ExpressionTree> instead of referring directly to this type.
    static interface 
    Deprecated.
    use Matcher<ExpressionTree> instead of referring directly to this type.
    static interface 
    Deprecated.
    use Matcher<ExpressionTree> instead of referring directly to this type.
    static interface 
    Deprecated.
    use Matcher<ExpressionTree> instead of referring directly to this type.
    static interface 
    Deprecated.
    use Matcher<ExpressionTree> instead of referring directly to this type.
    static interface 
    Deprecated.
    use Matcher<ExpressionTree> instead of referring directly to this type.
    Modifier and Type
    Method
    Description
    static Matcher<com.sun.source.tree.ExpressionTree>
    MethodInvocationMatcher.compile(Iterable<MethodInvocationMatcher.Rule> rules)
    Constructs a Matcher that matches for method invocations (including constructor invocations) satisfying at least one of the given Rule specifications.
  • Uses of Matcher in com.google.errorprone.util

    Method parameters in com.google.errorprone.util with type arguments of type Matcher
    Modifier and Type
    Method
    Description
    static List<com.sun.source.tree.ExpressionTree>
    ASTHelpers.matchBinaryTree(com.sun.source.tree.BinaryTree tree, List<Matcher<com.sun.source.tree.ExpressionTree>> matchers, VisitorState state)
    Given a BinaryTree to match against and a list of two matchers, applies the matchers to the operands in both orders.