Uses of Class
com.google.errorprone.VisitorState
Package
Description
Checks added to the java compiler which detect common bug patterns.
Bug patterns related to dependency
injection and JSR 330.
Bug patterns related to Dagger.
Bug patterns related to Guice.
Support code for providing automated corrections for defects we find.
A predicate DSL for matching javac AST nodes.
Supports matchers, but rather than giving Matcher implementations which are predicates on
individual AST nodes, a supplier gives contextual information from the traversal of the AST.
Utility code.
-
Uses of VisitorState in com.google.errorprone
Modifier and TypeMethodDescriptionstatic VisitorState
VisitorState.createConfiguredForCompilation
(com.sun.tools.javac.util.Context context, DescriptionListener listener, Map<String, BugPattern.SeverityLevel> severityMap, ErrorProneOptions errorProneOptions) Return a VisitorState configured for a new compilation, including Error Prone configuration.static VisitorState
VisitorState.createForCustomFindingCollection
(com.sun.tools.javac.util.Context context, DescriptionListener listener) Return a VisitorState that has no Error Prone configuration, but can report findings tolistener
.static VisitorState
VisitorState.createForUtilityPurposes
(com.sun.tools.javac.util.Context context) Return a VisitorState that has no Error Prone configuration, and can't report results.VisitorState.withPath
(com.sun.source.util.TreePath path) VisitorState.withSuppression
(SuppressionInfo.SuppressedState suppressedState) Modifier and TypeMethodDescriptionSuppressionInfo.forCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) Generates theSuppressionInfo
for aCompilationUnitTree
.SuppressionInfo.suppressedState
(Suppressible suppressible, boolean suppressedInGeneratedCode, VisitorState state) Returns true if this checker should be considered suppressed given the signals present in this object.SuppressionInfo.withExtendedSuppressions
(com.sun.tools.javac.code.Symbol sym, VisitorState state, Set<? extends com.sun.tools.javac.util.Name> customSuppressionAnnosToLookFor) Returns an instance ofSuppressionInfo
that takes into account any suppression signals present onsym
as well as those already stored inthis
. -
Uses of VisitorState in com.google.errorprone.bugpatterns
Modifier and TypeClassDescriptionclass
An abstract base class to match API usages in which the return value is not used.Modifier and TypeFieldDescriptionprotected final VisitorState
BugChecker.SuppressibleTreePathScanner.state
ShortCircuitBoolean.TreeScannerBinary.state
saved stateModifier and TypeMethodDescriptionstatic Fix
MissingFail.addFailCall
(com.sun.source.tree.TryTree tree, com.sun.source.tree.StatementTree lastTryStatement, VisitorState state) protected void
AbstractReferenceEquality.addFixes
(Description.Builder builder, com.sun.source.tree.BinaryTree tree, VisitorState state) StringSplitter.buildFix
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) CanBeStaticAnalyzer.canBeStaticResult
(com.sun.source.tree.Tree tree, com.sun.tools.javac.code.Symbol owner, VisitorState state) JUnit3TestNotRun.checkMethod
(com.sun.source.tree.MethodTree methodTree, com.google.common.collect.ImmutableSet<com.sun.tools.javac.code.Symbol.MethodSymbol> calledMethods, VisitorState state) Matches iff: Method's name begins with misspelled variation of "test".TypeCompatibility.compatibilityOfTypes
(com.sun.tools.javac.code.Type receiverType, com.sun.tools.javac.code.Type argumentType, VisitorState state) PreconditionsInvalidPlaceholder.describe
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) SelfAssignment.describeForAssignment
(com.sun.source.tree.AssignmentTree assignmentTree, VisitorState state) We expect that the lhs is a field and the rhs is an identifier, specifically a parameter to the method.SelfAssignment.describeForVarDecl
(com.sun.source.tree.VariableTree tree, VisitorState state) protected Description
AbstractReturnValueIgnored.describeReturnValueIgnored
(com.sun.source.tree.MemberReferenceTree memberReferenceTree, VisitorState state) Uses the default description for results ignored via a method reference.protected Description
AbstractReturnValueIgnored.describeReturnValueIgnored
(com.sun.source.tree.MethodInvocationTree methodInvocationTree, VisitorState state) Fixes the error by assigning the result of the call to the receiver reference, or deleting the method call.protected Description
AbstractReturnValueIgnored.describeReturnValueIgnored
(com.sun.source.tree.NewClassTree newClassTree, VisitorState state) Uses the default description for results ignored via a constructor call.protected Description
CheckReturnValue.describeReturnValueIgnored
(com.sun.source.tree.MemberReferenceTree tree, VisitorState state) protected Description
CheckReturnValue.describeReturnValueIgnored
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) protected Description
CheckReturnValue.describeReturnValueIgnored
(com.sun.source.tree.NewClassTree tree, VisitorState state) protected Description
IgnoredPureGetter.describeReturnValueIgnored
(com.sun.source.tree.MethodInvocationTree methodInvocationTree, VisitorState state) AbstractToString.descriptionMessageForDefaultMatch
(com.sun.tools.javac.code.Type type, VisitorState state) Adds the description message for match on the type without fixes.LiteProtoToString.descriptionMessageForDefaultMatch
(com.sun.tools.javac.code.Type type, VisitorState state) ObjectToString.descriptionMessageForDefaultMatch
(com.sun.tools.javac.code.Type type, VisitorState state) SymbolToString.descriptionMessageForDefaultMatch
(com.sun.tools.javac.code.Type type, VisitorState state) TreeToString.descriptionMessageForDefaultMatch
(com.sun.tools.javac.code.Type type, VisitorState state) TypeToString.descriptionMessageForDefaultMatch
(com.sun.tools.javac.code.Type type, VisitorState state) protected boolean
AbstractMustBeClosedChecker.exemptChange
(com.sun.source.tree.ExpressionTree tree, VisitorState state) Optional
<com.sun.tools.javac.code.Type> AbstractMockChecker.TypeExtractor.extract
(T tree, VisitorState state) Investigate the provided Tree, and return type information about it if it matches.protected static @Nullable SuggestedFix
SelfEquals.fieldFix
(com.sun.source.tree.Tree toReplace, VisitorState state) protected Optional
<AbstractMustBeClosedChecker.Change> AbstractMustBeClosedChecker.fix
(com.sun.source.tree.ExpressionTree tree, VisitorState state, com.google.errorprone.bugpatterns.AbstractMustBeClosedChecker.NameSuggester suggester) protected Optional
<AbstractMustBeClosedChecker.Change> StreamResourceLeak.fix
(com.sun.source.tree.ExpressionTree tree, VisitorState state, com.google.errorprone.bugpatterns.AbstractMustBeClosedChecker.NameSuggester suggester) static com.google.common.collect.ImmutableList
<Fix> ReplacementVariableFinder.fixesByReplacingExpressionWithLocallyDeclaredField
(com.sun.source.tree.ExpressionTree input, Predicate<com.sun.tools.javac.tree.JCTree.JCVariableDecl> validFieldPredicate, VisitorState state) Suggest replacinginput
with a qualified reference to a locally declared field with a similar or the same name as theinput
expression.static com.google.common.collect.ImmutableList
<Fix> ReplacementVariableFinder.fixesByReplacingExpressionWithMethodParameter
(com.sun.source.tree.ExpressionTree input, Predicate<com.sun.tools.javac.tree.JCTree.JCVariableDecl> validParameterPredicate, VisitorState state) Suggest replacinginput
with a reference to a method parameter in the nearest enclosing method declaration with a similar or the same name as theinput
expression.AbstractMockChecker.MockForbidder.forbidReason
(com.sun.tools.javac.code.Type type, VisitorState state) If the given type should not be mocked, provide an explanation why.protected abstract @Nullable String
AbstractUseSwitch.getExpressionForCase
(VisitorState state, com.sun.source.tree.ExpressionTree argument) Returns the source text that should appear in acase
statement in the fix.protected @Nullable String
UseEnumSwitch.getExpressionForCase
(VisitorState state, com.sun.source.tree.ExpressionTree argument) com.google.common.collect.ImmutableMap
<String, ?> CheckReturnValue.getMatchMetadata
(com.sun.source.tree.ExpressionTree tree, VisitorState state) com.google.common.collect.ImmutableMap
<String, ?> IgnoredPureGetter.getMatchMetadata
(com.sun.source.tree.ExpressionTree tree, VisitorState state) com.google.common.collect.ImmutableMap
<String, ?> ReturnValueIgnored.getMatchMetadata
(com.sun.source.tree.ExpressionTree tree, VisitorState state) AbstractReturnValueIgnored.getMethodPolicy
(com.sun.source.tree.ExpressionTree expression, VisitorState state) CheckReturnValue.getMethodPolicy
(com.sun.source.tree.ExpressionTree expression, VisitorState state) static boolean
ReferenceEquality.implementsEquals
(com.sun.tools.javac.code.Type type, VisitorState state) Check if the method declares or inherits an implementation of .equals()AbstractToString.implicitToStringFix
(com.sun.source.tree.ExpressionTree tree, VisitorState state) Constructs a fix for an implicit toString call, e.g.AnnotationMirrorToString.implicitToStringFix
(com.sun.source.tree.ExpressionTree tree, VisitorState state) AnnotationValueToString.implicitToStringFix
(com.sun.source.tree.ExpressionTree tree, VisitorState state) ArrayToString.implicitToStringFix
(com.sun.source.tree.ExpressionTree tree, VisitorState state) LiteProtoToString.implicitToStringFix
(com.sun.source.tree.ExpressionTree tree, VisitorState state) ObjectToString.implicitToStringFix
(com.sun.source.tree.ExpressionTree tree, VisitorState state) StreamToString.implicitToStringFix
(com.sun.source.tree.ExpressionTree tree, VisitorState state) SymbolToString.implicitToStringFix
(com.sun.source.tree.ExpressionTree tree, VisitorState state) TreeToString.implicitToStringFix
(com.sun.source.tree.ExpressionTree tree, VisitorState state) TypeToString.implicitToStringFix
(com.sun.source.tree.ExpressionTree tree, VisitorState state) protected abstract boolean
AbstractAsKeyOfSetOrMap.isBadType
(com.sun.tools.javac.code.Type type, VisitorState state) protected boolean
ArrayAsKeyOfSetOrMap.isBadType
(com.sun.tools.javac.code.Type type, VisitorState state) boolean
AbstractReturnValueIgnored.isCovered
(com.sun.source.tree.ExpressionTree tree, VisitorState state) boolean
CheckReturnValue.isCovered
(com.sun.source.tree.ExpressionTree tree, VisitorState state) boolean
BugChecker.isSuppressed
(com.sun.source.tree.Tree tree, VisitorState state) Returns true if the given tree is annotated with a@SuppressWarnings
that disables this bug checker.boolean
BugChecker.isSuppressed
(com.sun.tools.javac.code.Symbol sym, VisitorState state) Returns true if the given symbol is annotated with a@SuppressWarnings
or other annotation that disables this bug checker.protected Optional
<com.sun.tools.javac.code.Type> AbstractReturnValueIgnored.lostType
(VisitorState state) Check for occurrences of this type being lost, i.e.protected Optional
<com.sun.tools.javac.code.Type> FutureReturnValueIgnored.lostType
(VisitorState state) final Description
StronglyType.match
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) BugChecker.AnnotatedTypeTreeMatcher.matchAnnotatedType
(com.sun.source.tree.AnnotatedTypeTree tree, VisitorState state) BugChecker.AnnotationTreeMatcher.matchAnnotation
(com.sun.source.tree.AnnotationTree tree, VisitorState state) IncompatibleModifiersChecker.matchAnnotation
(com.sun.source.tree.AnnotationTree tree, VisitorState state) JUnit4ClassUsedInJUnit3.matchAnnotation
(com.sun.source.tree.AnnotationTree tree, VisitorState state) MissingSuperCall.matchAnnotation
(com.sun.source.tree.AnnotationTree tree, VisitorState state) Prevents abstract methods from being annotated with@CallSuper
et al.OutlineNone.matchAnnotation
(com.sun.source.tree.AnnotationTree tree, VisitorState state) Matches on@Template
annotations whose value contains "outline:none" or equivalent outline style.RequiredModifiersChecker.matchAnnotation
(com.sun.source.tree.AnnotationTree tree, VisitorState state) RestrictedApiChecker.matchAnnotation
(com.sun.source.tree.AnnotationTree tree, VisitorState state) Validates a@RestrictedApi
annotation and that the declared restriction makes sense.final Description
SuppressWarningsDeprecated.matchAnnotation
(com.sun.source.tree.AnnotationTree annotationTree, VisitorState state) protected abstract boolean
AbstractReferenceEquality.matchArgument
(com.sun.source.tree.ExpressionTree tree, VisitorState state) protected boolean
BoxedPrimitiveEquality.matchArgument
(com.sun.source.tree.ExpressionTree tree, VisitorState state) protected boolean
OptionalEquality.matchArgument
(com.sun.source.tree.ExpressionTree tree, VisitorState state) protected boolean
ReferenceEquality.matchArgument
(com.sun.source.tree.ExpressionTree tree, VisitorState state) BugChecker.ArrayAccessTreeMatcher.matchArrayAccess
(com.sun.source.tree.ArrayAccessTree tree, VisitorState state) BugChecker.ArrayTypeTreeMatcher.matchArrayType
(com.sun.source.tree.ArrayTypeTree tree, VisitorState state) AssertFalse.matchAssert
(com.sun.source.tree.AssertTree tree, VisitorState state) BugChecker.AssertTreeMatcher.matchAssert
(com.sun.source.tree.AssertTree tree, VisitorState state) BugChecker.AssignmentTreeMatcher.matchAssignment
(com.sun.source.tree.AssignmentTree tree, VisitorState state) CompileTimeConstantChecker.matchAssignment
(com.sun.source.tree.AssignmentTree node, VisitorState state) IdentityHashMapUsage.matchAssignment
(com.sun.source.tree.AssignmentTree tree, VisitorState state) IntLongMath.matchAssignment
(com.sun.source.tree.AssignmentTree tree, VisitorState state) NoAllocationChecker.matchAssignment
(com.sun.source.tree.AssignmentTree tree, VisitorState state) NonAtomicVolatileUpdate.matchAssignment
(com.sun.source.tree.AssignmentTree tree, VisitorState state) SelfAssignment.matchAssignment
(com.sun.source.tree.AssignmentTree tree, VisitorState state) UnnecessaryAssignment.matchAssignment
(com.sun.source.tree.AssignmentTree tree, VisitorState state) UnnecessaryBoxedAssignment.matchAssignment
(com.sun.source.tree.AssignmentTree tree, VisitorState state) final Description
AbstractReferenceEquality.matchBinary
(com.sun.source.tree.BinaryTree tree, VisitorState state) AbstractToString.matchBinary
(com.sun.source.tree.BinaryTree tree, VisitorState state) BadShiftAmount.matchBinary
(com.sun.source.tree.BinaryTree tree, VisitorState state) BugChecker.BinaryTreeMatcher.matchBinary
(com.sun.source.tree.BinaryTree tree, VisitorState state) ComparingThisWithNull.matchBinary
(com.sun.source.tree.BinaryTree tree, VisitorState state) ComparisonOutOfRange.matchBinary
(com.sun.source.tree.BinaryTree tree, VisitorState state) ComplexBooleanConstant.matchBinary
(com.sun.source.tree.BinaryTree tree, VisitorState state) ConstantOverflow.matchBinary
(com.sun.source.tree.BinaryTree tree, VisitorState state) EqualsNaN.matchBinary
(com.sun.source.tree.BinaryTree tree, VisitorState state) ErroneousBitwiseExpression.matchBinary
(com.sun.source.tree.BinaryTree tree, VisitorState state) IdentityBinaryExpression.matchBinary
(com.sun.source.tree.BinaryTree tree, VisitorState state) NarrowCalculation.matchBinary
(com.sun.source.tree.BinaryTree tree, VisitorState state) NoAllocationChecker.matchBinary
(com.sun.source.tree.BinaryTree tree, VisitorState state) OperatorPrecedence.matchBinary
(com.sun.source.tree.BinaryTree tree, VisitorState state) ProtoStringFieldReferenceEquality.matchBinary
(com.sun.source.tree.BinaryTree tree, VisitorState state) RandomModInteger.matchBinary
(com.sun.source.tree.BinaryTree tree, VisitorState state) ShortCircuitBoolean.matchBinary
(com.sun.source.tree.BinaryTree tree, VisitorState state) SizeGreaterThanOrEqualsZero.matchBinary
(com.sun.source.tree.BinaryTree tree, VisitorState state) XorPower.matchBinary
(com.sun.source.tree.BinaryTree tree, VisitorState state) YodaCondition.matchBinary
(com.sun.source.tree.BinaryTree tree, VisitorState state) BugChecker.BlockTreeMatcher.matchBlock
(com.sun.source.tree.BlockTree tree, VisitorState state) MultiVariableDeclaration.matchBlock
(com.sun.source.tree.BlockTree tree, VisitorState state) BugChecker.BreakTreeMatcher.matchBreak
(com.sun.source.tree.BreakTree tree, VisitorState state) Finally.matchBreak
(com.sun.source.tree.BreakTree tree, VisitorState state) BugChecker.CaseTreeMatcher.matchCase
(com.sun.source.tree.CaseTree tree, VisitorState state) TraditionalSwitchExpression.matchCase
(com.sun.source.tree.CaseTree tree, VisitorState state) UnnecessaryBreakInSwitch.matchCase
(com.sun.source.tree.CaseTree tree, VisitorState state) BugChecker.CatchTreeMatcher.matchCatch
(com.sun.source.tree.CatchTree tree, VisitorState state) CatchAndPrintStackTrace.matchCatch
(com.sun.source.tree.CatchTree tree, VisitorState state) EmptyCatch.matchCatch
(com.sun.source.tree.CatchTree tree, VisitorState state) UnusedException.matchCatch
(com.sun.source.tree.CatchTree tree, VisitorState state) AmbiguousMethodReference.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) AnnotationPosition.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) AutoValueBoxedValues.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) AutoValueFinalMethods.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) AutoValueImmutableFields.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) BadAnnotationImplementation.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) BanClassLoader.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) BugChecker.ClassTreeMatcher.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) BugPatternNaming.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) CheckReturnValue.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) Validate that at most one ofCheckReturnValue
andCanIgnoreReturnValue
are applied to a class (or interface or enum).ClassCanBeStatic.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) ClassInitializationDeadlock.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) ClassNamedLikeTypeParameter.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) ComparableAndComparator.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) ComparableType.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) ConstantPatternCompile.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) DepAnn.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) EqualsHashCode.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) ExtendingJUnitAssert.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) ExtendsAutoValue.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) FunctionalInterfaceClash.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) HidingField.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState visitorState) IdentifierName.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) ImmutableMemberCollection.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) ImmutableSetForContains.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) InconsistentCapitalization.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) InconsistentHashCode.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) InputStreamSlowMultibyteRead.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) InterfaceWithOnlyStatics.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) IterableAndIterator.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) JavaLangClash.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) JdkObsolete.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) JUnit4TestNotRun.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) JUnitAmbiguousTestClass.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) MissingRefasterAnnotation.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) MultiVariableDeclaration.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) MustBeClosedChecker.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) NamedLikeContextualKeyword.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) OverrideThrowableToString.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) ParametersButNotParameterized.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) PrivateConstructorForUtilityClass.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) ProtectedMembersInFinalClass.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) TestParametersNotInitialized.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) TheoryButNoTheories.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) TypeNameShadowing.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) TypeParameterShadowing.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) UngroupedOverloads.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) VarTypeName.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) AlreadyChecked.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) AutoValueSubclassLeaked.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) BugChecker.CompilationUnitTreeMatcher.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) ChainingConstructorIgnoresParameter.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) ClassName.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) DeduplicateConstants.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) DeeplyNested.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) DefaultPackage.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) DifferentNameButSame.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) DirectInvocationOnMock.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) DoNotCallChecker.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) EmptyTopLevelDeclaration.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) FieldCanBeFinal.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) FieldCanBeLocal.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) ImpossibleNullComparison.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) InlineTrivialConstant.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) JUnit3TestNotRun.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree unused, VisitorState state) JUnit4TestsNotRunWithinEnclosed.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) MemoizeConstantVisitorStateLookups.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) MethodCanBeStatic.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) MixedMutabilityReturnType.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) MockitoDoSetup.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) MockNotUsedInProduction.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) MultipleTopLevelClasses.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) OptionalNotPresent.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) PackageInfo.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) PackageLocation.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) PreferredInterfaceType.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) RemoveUnusedImports.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree compilationUnitTree, VisitorState state) SameNameButDifferent.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) StronglyTypeByteString.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) SuppressWarningsWithoutExplanation.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) UnicodeDirectionalityCharacters.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) UnicodeEscape.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) UnicodeInCode.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) UnnecessarilyFullyQualified.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) UnnecessaryBoxedVariable.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) UnnecessaryTestMethodPrefix.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) UnusedLabel.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) UnusedMethod.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) UnusedNestedClass.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) UnusedTypeParameter.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) UnusedVariable.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) WildcardImport.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) AbstractToString.matchCompoundAssignment
(com.sun.source.tree.CompoundAssignmentTree tree, VisitorState state) BugChecker.CompoundAssignmentTreeMatcher.matchCompoundAssignment
(com.sun.source.tree.CompoundAssignmentTree tree, VisitorState state) NarrowingCompoundAssignment.matchCompoundAssignment
(com.sun.source.tree.CompoundAssignmentTree tree, VisitorState state) NoAllocationChecker.matchCompoundAssignment
(com.sun.source.tree.CompoundAssignmentTree tree, VisitorState state) NonAtomicVolatileUpdate.matchCompoundAssignment
(com.sun.source.tree.CompoundAssignmentTree tree, VisitorState state) BugChecker.ConditionalExpressionTreeMatcher.matchConditionalExpression
(com.sun.source.tree.ConditionalExpressionTree tree, VisitorState state) ConditionalExpressionNumericPromotion.matchConditionalExpression
(com.sun.source.tree.ConditionalExpressionTree conditionalExpression, VisitorState state) DuplicateBranches.matchConditionalExpression
(com.sun.source.tree.ConditionalExpressionTree tree, VisitorState state) NullTernary.matchConditionalExpression
(com.sun.source.tree.ConditionalExpressionTree conditionalExpression, VisitorState state) OperatorPrecedence.matchConditionalExpression
(com.sun.source.tree.ConditionalExpressionTree tree, VisitorState state) BugChecker.ContinueTreeMatcher.matchContinue
(com.sun.source.tree.ContinueTree tree, VisitorState state) Finally.matchContinue
(com.sun.source.tree.ContinueTree tree, VisitorState state) BugChecker.DoWhileLoopTreeMatcher.matchDoWhileLoop
(com.sun.source.tree.DoWhileLoopTree tree, VisitorState state) LogicalAssignment.matchDoWhileLoop
(com.sun.source.tree.DoWhileLoopTree tree, VisitorState state) LoopConditionChecker.matchDoWhileLoop
(com.sun.source.tree.DoWhileLoopTree tree, VisitorState state) MissingBraces.matchDoWhileLoop
(com.sun.source.tree.DoWhileLoopTree tree, VisitorState state) BugChecker.EmptyStatementTreeMatcher.matchEmptyStatement
(com.sun.source.tree.EmptyStatementTree tree, VisitorState state) EmptyIfStatement.matchEmptyStatement
(com.sun.source.tree.EmptyStatementTree tree, VisitorState state) Match empty statement if: - Parent statement is an if - The then part of the parent if is an empty statement, and - The else part of the parent if does not existBugChecker.EnhancedForLoopTreeMatcher.matchEnhancedForLoop
(com.sun.source.tree.EnhancedForLoopTree tree, VisitorState state) LoopOverCharArray.matchEnhancedForLoop
(com.sun.source.tree.EnhancedForLoopTree tree, VisitorState state) MissingBraces.matchEnhancedForLoop
(com.sun.source.tree.EnhancedForLoopTree tree, VisitorState state) NoAllocationChecker.matchEnhancedForLoop
(com.sun.source.tree.EnhancedForLoopTree tree, VisitorState state) boolean
TypesWithUndefinedEquality.matchesType
(com.sun.tools.javac.code.Type type, VisitorState state) BugChecker.ExpressionStatementTreeMatcher.matchExpressionStatement
(com.sun.source.tree.ExpressionStatementTree tree, VisitorState state) ModifiedButNotUsed.matchExpressionStatement
(com.sun.source.tree.ExpressionStatementTree tree, VisitorState state) BugChecker.ForLoopTreeMatcher.matchForLoop
(com.sun.source.tree.ForLoopTree tree, VisitorState state) IncrementInForLoopAndHeader.matchForLoop
(com.sun.source.tree.ForLoopTree forLoopTree, VisitorState visitorState) LogicalAssignment.matchForLoop
(com.sun.source.tree.ForLoopTree tree, VisitorState state) LoopConditionChecker.matchForLoop
(com.sun.source.tree.ForLoopTree tree, VisitorState state) MissingBraces.matchForLoop
(com.sun.source.tree.ForLoopTree tree, VisitorState state) protected <T extends com.sun.source.tree.Tree>
DescriptionAbstractBanUnsafeAPIChecker.matchHelper
(T tree, VisitorState state, Matcher<T> matcher) BugChecker.IdentifierTreeMatcher.matchIdentifier
(com.sun.source.tree.IdentifierTree tree, VisitorState state) SunApi.matchIdentifier
(com.sun.source.tree.IdentifierTree tree, VisitorState state) VoidUsed.matchIdentifier
(com.sun.source.tree.IdentifierTree tree, VisitorState state) AbstractUseSwitch.matchIf
(com.sun.source.tree.IfTree tree, VisitorState state) BugChecker.IfTreeMatcher.matchIf
(com.sun.source.tree.IfTree tree, VisitorState state) DuplicateBranches.matchIf
(com.sun.source.tree.IfTree tree, VisitorState state) ImplementAssertionWithChaining.matchIf
(com.sun.source.tree.IfTree ifTree, VisitorState state) LogicalAssignment.matchIf
(com.sun.source.tree.IfTree tree, VisitorState state) MissingBraces.matchIf
(com.sun.source.tree.IfTree tree, VisitorState state) NestedInstanceOfConditions.matchIf
(com.sun.source.tree.IfTree ifTree, VisitorState visitorState) PatternMatchingInstanceof.matchIf
(com.sun.source.tree.IfTree tree, VisitorState state) BadImport.matchImport
(com.sun.source.tree.ImportTree tree, VisitorState state) BugChecker.ImportTreeMatcher.matchImport
(com.sun.source.tree.ImportTree tree, VisitorState state) NonCanonicalStaticImport.matchImport
(com.sun.source.tree.ImportTree tree, VisitorState state) NonCanonicalStaticMemberImport.matchImport
(com.sun.source.tree.ImportTree tree, VisitorState state) UnnecessaryStaticImport.matchImport
(com.sun.source.tree.ImportTree tree, VisitorState state) BadInstanceof.matchInstanceOf
(com.sun.source.tree.InstanceOfTree tree, VisitorState state) BugChecker.InstanceOfTreeMatcher.matchInstanceOf
(com.sun.source.tree.InstanceOfTree tree, VisitorState state) BugChecker.IntersectionTypeTreeMatcher.matchIntersectionType
(com.sun.source.tree.IntersectionTypeTree tree, VisitorState state) BugChecker.LabeledStatementTreeMatcher.matchLabeledStatement
(com.sun.source.tree.LabeledStatementTree tree, VisitorState state) LabelledBreakTarget.matchLabeledStatement
(com.sun.source.tree.LabeledStatementTree tree, VisitorState state) BugChecker.LambdaExpressionTreeMatcher.matchLambdaExpression
(com.sun.source.tree.LambdaExpressionTree tree, VisitorState state) CompileTimeConstantChecker.matchLambdaExpression
(com.sun.source.tree.LambdaExpressionTree node, VisitorState state) StreamToIterable.matchLambdaExpression
(com.sun.source.tree.LambdaExpressionTree tree, VisitorState state) BugChecker.LiteralTreeMatcher.matchLiteral
(com.sun.source.tree.LiteralTree tree, VisitorState state) DangerousLiteralNullChecker.matchLiteral
(com.sun.source.tree.LiteralTree tree, VisitorState state) FloatingPointLiteralPrecision.matchLiteral
(com.sun.source.tree.LiteralTree tree, VisitorState state) LongLiteralLowerCaseSuffix.matchLiteral
(com.sun.source.tree.LiteralTree literalTree, VisitorState state) MisleadingEscapedSpace.matchLiteral
(com.sun.source.tree.LiteralTree tree, VisitorState state) OrphanedFormatString.matchLiteral
(com.sun.source.tree.LiteralTree tree, VisitorState state) SwigMemoryLeak.matchLiteral
(com.sun.source.tree.LiteralTree tree, VisitorState state) AbstractReturnValueIgnored.matchMemberReference
(com.sun.source.tree.MemberReferenceTree tree, VisitorState state) BugChecker.MemberReferenceTreeMatcher.matchMemberReference
(com.sun.source.tree.MemberReferenceTree tree, VisitorState state) CompileTimeConstantChecker.matchMemberReference
(com.sun.source.tree.MemberReferenceTree node, VisitorState state) EqualsIncompatibleType.matchMemberReference
(com.sun.source.tree.MemberReferenceTree tree, VisitorState state) IsInstanceIncompatibleType.matchMemberReference
(com.sun.source.tree.MemberReferenceTree tree, VisitorState state) JdkObsolete.matchMemberReference
(com.sun.source.tree.MemberReferenceTree tree, VisitorState state) ModifySourceCollectionInStream.matchMemberReference
(com.sun.source.tree.MemberReferenceTree tree, VisitorState state) RestrictedApiChecker.matchMemberReference
(com.sun.source.tree.MemberReferenceTree tree, VisitorState state) RxReturnValueIgnored.matchMemberReference
(com.sun.source.tree.MemberReferenceTree tree, VisitorState state) StreamToIterable.matchMemberReference
(com.sun.source.tree.MemberReferenceTree tree, VisitorState state) UnnecessaryMethodReference.matchMemberReference
(com.sun.source.tree.MemberReferenceTree tree, VisitorState state) BugChecker.MemberSelectTreeMatcher.matchMemberSelect
(com.sun.source.tree.MemberSelectTree tree, VisitorState state) NonCanonicalType.matchMemberSelect
(com.sun.source.tree.MemberSelectTree tree, VisitorState state) NullableOnContainingClass.matchMemberSelect
(com.sun.source.tree.MemberSelectTree tree, VisitorState state) StaticQualifiedUsingExpression.matchMemberSelect
(com.sun.source.tree.MemberSelectTree tree, VisitorState state) SunApi.matchMemberSelect
(com.sun.source.tree.MemberSelectTree tree, VisitorState state) SystemOut.matchMemberSelect
(com.sun.source.tree.MemberSelectTree tree, VisitorState state) TypeParameterQualifier.matchMemberSelect
(com.sun.source.tree.MemberSelectTree tree, VisitorState state) VoidUsed.matchMemberSelect
(com.sun.source.tree.MemberSelectTree tree, VisitorState state) AnnotationPosition.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) AutoValueBuilderDefaultsInConstructor.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) AvoidObjectArrays.matchMethod
(com.sun.source.tree.MethodTree method, VisitorState state) BugChecker.MethodTreeMatcher.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) CacheLoaderNull.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) ChainingConstructorIgnoresParameter.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) CheckedExceptionNotThrown.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) CheckNotNullMultipleTimes.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) CheckReturnValue.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) Validate@CheckReturnValue
andCanIgnoreReturnValue
usage on methods.ComparisonContractViolated.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) CompileTimeConstantChecker.matchMethod
(com.sun.source.tree.MethodTree node, VisitorState state) DepAnn.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) DoNotCallChecker.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) DoNotCallSuggester.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) DoNotClaimAnnotations.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) EqualsReference.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState visitorState) EqualsUnsafeCast.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) EqualsWrongThing.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) ExpectedExceptionChecker.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) Finalize.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) ForOverrideChecker.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) FunctionalInterfaceMethodChanged.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) IdentifierName.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) IncorrectMainMethod.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) InfiniteRecursion.matchMethod
(com.sun.source.tree.MethodTree declaration, VisitorState state) InjectOnBugCheckers.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) InterruptedExceptionSwallowed.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) JUnit4ClassAnnotationNonStatic.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) JUnitParameterMethodNotFound.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) LambdaFunctionalInterface.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) Identifies methods with parameters that have a generic argument with Int, Long, or Double.MissingImplementsComparable.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) MissingOverride.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) MissingSuperCall.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) Matches a method that overrides a method that has been annotated with@CallSuper
et al., but does not call the super method.MissingTestCall.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) MixedArrayDimensions.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) MustBeClosedChecker.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) Check that theMustBeClosed
annotation is only used for constructors of AutoCloseables and methods that return an AutoCloseable.NamedLikeContextualKeyword.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) NoAllocationChecker.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) NonApiType.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) NonFinalCompileTimeConstant.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) NonOverridingEquals.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) NullableConstructor.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) NullableOnContainingClass.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) NullableOptional.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) NullableVoid.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) Overrides.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) OverridingMethodInconsistentArgumentNamesChecker.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) PublicApiNamedStreamShouldReturnStream.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) RedundantOverride.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) RedundantThrows.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) ReturnAtTheEndOfVoidFunction.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) SelfAlwaysReturnsThis.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) StaticAssignmentInConstructor.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) StaticAssignmentOfThrowable.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) StreamResourceLeak.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) TestExceptionChecker.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) ThrowsUncheckedException.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) TooManyParameters.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) ToStringReturnsNull.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) TypeNameShadowing.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) TypeParameterShadowing.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) TypeParameterUnusedInFormals.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) UnnecessarilyVisible.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) UnnecessaryLambda.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) UnsynchronizedOverridesSynchronized.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) UseCorrectAssertInTests.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) AbstractAsKeyOfSetOrMap.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) final Description
AbstractMockChecker.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) AbstractPatternSyntaxChecker.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) AbstractReturnValueIgnored.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree methodInvocationTree, VisitorState state) AbstractToString.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) AddressSelection.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) AlwaysThrows.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) AnnotateFormatMethod.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ArrayEquals.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree t, VisitorState state) Suggests replacing with Arrays.equals(a, b).ArrayFillIncompatibleType.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree invocationTree, VisitorState state) ArrayHashCode.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) Wraps identity hashcode computations in calls toArrays.hashCode(long[])
if the array is single dimensional orArrays.deepHashCode(java.lang.Object[])
if the array is multidimensional.ArraysAsListPrimitiveArray.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) AssertionFailureIgnored.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) AssertThrowsMultipleStatements.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ASTHelpersSuggestions.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) BanClassLoader.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) BanJNDI.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) BanSerializableRead.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) BigDecimalEquals.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) BooleanParameter.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) BugChecker.MethodInvocationTreeMatcher.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ByteBufferBackingArray.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) CannotMockFinalClass.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) CannotMockMethod.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) CanonicalDuration.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ChainedAssertionLosesContext.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ChainingConstructorIgnoresParameter.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) CharacterGetNumericValue.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ClassNewInstance.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) CollectionToArraySafeParameter.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree methodInvocationTree, VisitorState visitorState) CollectorShouldNotUseState.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree methodInvocationTree, VisitorState visitorState) CompareToZero.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) CompileTimeConstantChecker.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ComputeIfAbsentAmbiguousReference.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) DefaultCharset.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) DefaultLocale.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) DistinctVarargsChecker.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) DuplicateMapKeys.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) EnumOrdinal.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) EqualsGetClass.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) EqualsIncompatibleType.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree invocationTree, VisitorState state) EqualsNull.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree invocationTree, VisitorState state) EqualsUsingHashCode.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) FloatingPointAssertionWithinEpsilon.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ForOverrideChecker.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) FuturesGetCheckedIllegalExceptionType.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) FutureTransformAsync.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) FuzzyEqualsShouldNotBeUsedInEqualsMethod.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) GetClassOnAnnotation.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) GetClassOnClass.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) Suggests removing getClass() or changing to Class.class.GetClassOnEnum.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) GuiceNestedCombine.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) HashtableContains.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ICCProfileGetInstance.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) IdentityHashMapBoxing.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) IdentityHashMapUsage.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) IndexOfChar.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) InexactVarargsConditional.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) InsecureCipherMode.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) Interruption.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) InvalidTimeZoneID.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) InvalidZoneId.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) IsInstanceIncompatibleType.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) IsInstanceOfClass.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) Suggests removing getClass() or changing to Class.class.JavaUtilDateChecker.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) JUnit3FloatingPointComparisonWithoutDelta.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree methodInvocationTree, VisitorState state) JUnit4ClassUsedInJUnit3.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) JUnitAssertSameCheck.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree methodInvocationTree, VisitorState state) LenientFormatStringValidation.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) LiteByteStringUtf8.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) LiteEnumValueOf.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree methodInvocationTree, VisitorState state) LockNotBeforeTry.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) LockOnBoxedPrimitive.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) LongDoubleConversion.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) LongFloatConversion.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) LossyPrimitiveCompare.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) MathAbsoluteNegative.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) MathRoundIntLong.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) MisformattedTestData.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) MisusedDateFormat.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) MixedDescriptors.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) MockitoUsage.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ModifyCollectionInEnhancedForLoop.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ModifyingCollectionWithItself.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree t, VisitorState state) Matches calls to addAll, containsAll, removeAll, and retainAll on itselfModifySourceCollectionInStream.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) MultimapKeys.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) MultipleParallelOrSequentialCalls.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree t, VisitorState state) MultipleUnaryOperatorsInMethodCall.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree methodInvocationTree, VisitorState visitorState) NamedLikeContextualKeyword.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) NCopiesOfChar.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) NewFileSystem.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) NoAllocationChecker.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) NonRuntimeAnnotation.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) NullOptional.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ObjectEqualsForPrimitives.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ObjectsHashCodePrimitive.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) OptionalMapToOptional.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) OptionalMapUnusedValue.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) OptionalOfRedundantMethod.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) OutlineNone.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) Matches onsetProperty("outline", "none")
and equivalent method calls.ParameterComment.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ParameterName.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) PreconditionsCheckNotNullRepeated.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree methodInvocationTree, VisitorState state) PreconditionsInvalidPlaceholder.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) PrimitiveArrayPassedToVarargsMethod.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree t, VisitorState state) PrimitiveAtomicReference.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) PrivateSecurityContractProtoAccess.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ProtoBuilderReturnValueIgnored.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ProtocolBufferOrdinal.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree methodInvocationTree, VisitorState state) ProtoTruthMixedDescriptors.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) RandomCast.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ReachabilityFenceUsage.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) RedundantSetterCall.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) RestrictedApiChecker.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) RobolectricShadowDirectlyOn.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) RxReturnValueIgnored.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) SelfAssertion.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) SelfComparison.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree methodInvocationTree, VisitorState state) SelfEquals.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) SetUnrecognized.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ShouldHaveEvenArgs.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree methodInvocationTree, VisitorState state) StringCaseLocaleUsage.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) StringCharset.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) StringFormatWithLiteral.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) StringSplitter.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) SubstringOfZero.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) SuperCallToObjectMethod.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) SystemConsoleNull.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) SystemExitOutsideMain.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) SystemOut.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ThreadJoinLoop.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree methodInvocationTree, VisitorState state) ThreeLetterTimeZoneID.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ThrowIfUncheckedKnownChecked.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ThrowIfUncheckedKnownUnchecked.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) TruthAssertExpected.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) TruthConstantAsserts.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree methodInvocationTree, VisitorState state) TruthContainsExactlyElementsInUsage.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) TruthGetOrDefault.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) TypeEqualsChecker.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) UndefinedEquals.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) UnnecessaryLongToIntConversion.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) Matches if a long or Long is converted to an int for a long parameter in a method invocation.UnnecessaryMethodInvocationMatcher.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) UnnecessaryOptionalGet.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) UnnecessarySetDefault.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) UnnecessaryTypeArgument.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) UnsafeFinalization.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) UnsafeLocaleUsage.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) UnusedCollectionModifiedInPlace.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) URLEqualsHashCode.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) WaitNotInLoop.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) WithSignatureDiscouraged.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) YodaCondition.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) BugChecker.ModifiersTreeMatcher.matchModifiers
(com.sun.source.tree.ModifiersTree tree, VisitorState state) BugChecker.NewArrayTreeMatcher.matchNewArray
(com.sun.source.tree.NewArrayTree tree, VisitorState state) NoAllocationChecker.matchNewArray
(com.sun.source.tree.NewArrayTree tree, VisitorState state) AbstractAsKeyOfSetOrMap.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) AbstractReturnValueIgnored.matchNewClass
(com.sun.source.tree.NewClassTree newClassTree, VisitorState state) AddressSelection.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) BanClassLoader.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) BigDecimalLiteralDouble.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) BooleanParameter.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) BoxedPrimitiveConstructor.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) BugChecker.NewClassTreeMatcher.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) CompileTimeConstantChecker.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) DeadException.matchNewClass
(com.sun.source.tree.NewClassTree newClassTree, VisitorState state) DeadThread.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) DefaultCharset.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) DefaultLocale.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) DoubleBraceInitialization.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) ErroneousThreadPoolConstructorChecker.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) IdentityHashMapBoxing.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) IdentityHashMapUsage.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) Incomparable.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) JavaUtilDateChecker.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) JdkObsolete.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) MisusedDateFormat.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) NoAllocationChecker.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) NullOptional.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) ParameterComment.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) ParameterName.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) RestrictedApiChecker.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) StringBuilderInitWithChar.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) StringCharset.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) ThreadLocalUsage.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) ThrowSpecificExceptions.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) UnnecessaryStringBuilder.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) UnnecessaryTypeArgument.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) UnsafeLocaleUsage.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) UnusedAnonymousClass.matchNewClass
(com.sun.source.tree.NewClassTree newClassTree, VisitorState state) URLEqualsHashCode.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) BugChecker.ParameterizedTypeTreeMatcher.matchParameterizedType
(com.sun.source.tree.ParameterizedTypeTree tree, VisitorState state) BugChecker.ParenthesizedTreeMatcher.matchParenthesized
(com.sun.source.tree.ParenthesizedTree tree, VisitorState state) UnnecessaryParentheses.matchParenthesized
(com.sun.source.tree.ParenthesizedTree tree, VisitorState state) BugChecker.PrimitiveTypeTreeMatcher.matchPrimitiveType
(com.sun.source.tree.PrimitiveTypeTree tree, VisitorState state) protected abstract Description
AbstractPatternSyntaxChecker.matchRegexLiteral
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state, String pattern, int flags) protected final Description
BareDotMetacharacter.matchRegexLiteral
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state, String regex, int flags) protected final Description
InvalidPatternSyntax.matchRegexLiteral
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state, String pattern, int flags) AbstractReturnValueIgnored.matchReturn
(com.sun.source.tree.ReturnTree tree, VisitorState state) Returning a type from a lambda or method that returns Object loses the type information.BugChecker.ReturnTreeMatcher.matchReturn
(com.sun.source.tree.ReturnTree tree, VisitorState state) Finally.matchReturn
(com.sun.source.tree.ReturnTree tree, VisitorState state) IntLongMath.matchReturn
(com.sun.source.tree.ReturnTree tree, VisitorState state) NoAllocationChecker.matchReturn
(com.sun.source.tree.ReturnTree tree, VisitorState state) UnnecessaryBoxedAssignment.matchReturn
(com.sun.source.tree.ReturnTree tree, VisitorState state) BugChecker.SwitchTreeMatcher.matchSwitch
(com.sun.source.tree.SwitchTree tree, VisitorState state) FallThrough.matchSwitch
(com.sun.source.tree.SwitchTree tree, VisitorState state) MissingCasesInEnumSwitch.matchSwitch
(com.sun.source.tree.SwitchTree tree, VisitorState state) MissingDefault.matchSwitch
(com.sun.source.tree.SwitchTree tree, VisitorState state) StatementSwitchToExpressionSwitch.matchSwitch
(com.sun.source.tree.SwitchTree switchTree, VisitorState state) SwitchDefault.matchSwitch
(com.sun.source.tree.SwitchTree tree, VisitorState state) UnnecessaryDefaultInEnumSwitch.matchSwitch
(com.sun.source.tree.SwitchTree switchTree, VisitorState state) WrongOneof.matchSwitch
(com.sun.source.tree.SwitchTree tree, VisitorState state) BugChecker.SynchronizedTreeMatcher.matchSynchronized
(com.sun.source.tree.SynchronizedTree tree, VisitorState state) LockOnBoxedPrimitive.matchSynchronized
(com.sun.source.tree.SynchronizedTree tree, VisitorState state) LockOnNonEnclosingClassLiteral.matchSynchronized
(com.sun.source.tree.SynchronizedTree tree, VisitorState state) BugChecker.ThrowTreeMatcher.matchThrow
(com.sun.source.tree.ThrowTree tree, VisitorState state) Finally.matchThrow
(com.sun.source.tree.ThrowTree tree, VisitorState state) RethrowReflectiveOperationExceptionAsLinkageError.matchThrow
(com.sun.source.tree.ThrowTree throwTree, VisitorState state) ThrowNull.matchThrow
(com.sun.source.tree.ThrowTree tree, VisitorState state) BugChecker.TryTreeMatcher.matchTry
(com.sun.source.tree.TryTree tree, VisitorState state) CatchFail.matchTry
(com.sun.source.tree.TryTree tree, VisitorState state) CatchingUnchecked.matchTry
(com.sun.source.tree.TryTree tree, VisitorState state) ClosingStandardOutputStreams.matchTry
(com.sun.source.tree.TryTree tree, VisitorState state) InterruptedExceptionSwallowed.matchTry
(com.sun.source.tree.TryTree tree, VisitorState state) MissingFail.matchTry
(com.sun.source.tree.TryTree tree, VisitorState state) TryFailRefactoring.matchTry
(com.sun.source.tree.TryTree tree, VisitorState state) TryFailThrowable.matchTry
(com.sun.source.tree.TryTree tree, VisitorState state) TryWithResourcesVariable.matchTry
(com.sun.source.tree.TryTree tree, VisitorState state) BadComparable.matchTypeCast
(com.sun.source.tree.TypeCastTree tree, VisitorState state) BugChecker.TypeCastTreeMatcher.matchTypeCast
(com.sun.source.tree.TypeCastTree tree, VisitorState state) FloatCast.matchTypeCast
(com.sun.source.tree.TypeCastTree tree, VisitorState state) InstanceOfAndCastMatchWrongType.matchTypeCast
(com.sun.source.tree.TypeCastTree typeCastTree, VisitorState visitorState) NegativeCharLiteral.matchTypeCast
(com.sun.source.tree.TypeCastTree tree, VisitorState state) NoAllocationChecker.matchTypeCast
(com.sun.source.tree.TypeCastTree tree, VisitorState state) UnsafeReflectiveConstructionCast.matchTypeCast
(com.sun.source.tree.TypeCastTree typeCastTree, VisitorState state) BugChecker.TypeParameterTreeMatcher.matchTypeParameter
(com.sun.source.tree.TypeParameterTree tree, VisitorState state) JavaLangClash.matchTypeParameter
(com.sun.source.tree.TypeParameterTree tree, VisitorState state) TypeParameterNaming.matchTypeParameter
(com.sun.source.tree.TypeParameterTree tree, VisitorState state) VarTypeName.matchTypeParameter
(com.sun.source.tree.TypeParameterTree tree, VisitorState state) AttemptedNegativeZero.matchUnary
(com.sun.source.tree.UnaryTree tree, VisitorState state) BugChecker.UnaryTreeMatcher.matchUnary
(com.sun.source.tree.UnaryTree tree, VisitorState state) DiscardedPostfixExpression.matchUnary
(com.sun.source.tree.UnaryTree tree, VisitorState state) NoAllocationChecker.matchUnary
(com.sun.source.tree.UnaryTree tree, VisitorState state) NonAtomicVolatileUpdate.matchUnary
(com.sun.source.tree.UnaryTree tree, VisitorState state) BugChecker.UnionTypeTreeMatcher.matchUnionType
(com.sun.source.tree.UnionTypeTree tree, VisitorState state) final Description
AbstractMockChecker.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) AnnotationPosition.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) ArrayRecordComponent.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) BugChecker.VariableTreeMatcher.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) CannotMockFinalClass.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) CompileTimeConstantChecker.matchVariable
(com.sun.source.tree.VariableTree node, VisitorState state) ConstantField.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) DateFormatConstant.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) DepAnn.matchVariable
(com.sun.source.tree.VariableTree variableTree, VisitorState state) DeprecatedVariable.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) FieldCanBeStatic.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) ForEachIterable.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) IdentifierName.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) IdentityHashMapUsage.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) InitializeInline.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) IntLongMath.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) IterablePathParameter.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) MixedArrayDimensions.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) ModifiedButNotUsed.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) MutableGuiceModule.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) MutablePublicArray.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) NoAllocationChecker.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) NonFinalStaticField.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) NullableOnContainingClass.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) NullableOptional.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) SelfAssignment.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) StaticAssignmentOfThrowable.matchVariable
(com.sun.source.tree.VariableTree variableTree, VisitorState state) StaticMockMember.matchVariable
(com.sun.source.tree.VariableTree varTree, VisitorState state) TransientMisuse.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) UnnecessaryAnonymousClass.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) UnnecessaryAssignment.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) UnnecessaryAsync.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) UnnecessaryBoxedAssignment.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) UnnecessaryFinal.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) UnnecessaryLambda.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) VarChecker.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) VariableNameSameAsType.matchVariable
(com.sun.source.tree.VariableTree varTree, VisitorState state) Varifier.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) BugChecker.WhileLoopTreeMatcher.matchWhileLoop
(com.sun.source.tree.WhileLoopTree tree, VisitorState state) LogicalAssignment.matchWhileLoop
(com.sun.source.tree.WhileLoopTree tree, VisitorState state) LoopConditionChecker.matchWhileLoop
(com.sun.source.tree.WhileLoopTree tree, VisitorState state) MissingBraces.matchWhileLoop
(com.sun.source.tree.WhileLoopTree tree, VisitorState state) BugChecker.WildcardTreeMatcher.matchWildcard
(com.sun.source.tree.WildcardTree tree, VisitorState state) static String
SameNameButDifferent.qualifyType
(VisitorState state, SuggestedFix.Builder fix, com.sun.tools.javac.code.Symbol sym) Try to qualify the type, or return the full name.static boolean
CanBeStaticAnalyzer.referencesOuter
(com.sun.source.tree.Tree tree, com.sun.tools.javac.code.Symbol owner, VisitorState state) Returns true if the tree references its enclosing class.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 matchingmatcher
, emitting them as a single fix.boolean
BugChecker.suppressedByAnyOf
(Set<com.sun.tools.javac.util.Name> annotations, VisitorState s) com.google.common.collect.ImmutableRangeSet
<Integer> BugChecker.suppressedRegions
(VisitorState state) Computes a RangeSet of code regions which are suppressed by this bug checker.AbstractToString.toStringFix
(com.sun.source.tree.Tree parent, com.sun.source.tree.ExpressionTree expression, VisitorState state) Constructs a fix for an explicit toString call, e.g.AnnotationMirrorToString.toStringFix
(com.sun.source.tree.Tree parent, com.sun.source.tree.ExpressionTree tree, VisitorState state) AnnotationValueToString.toStringFix
(com.sun.source.tree.Tree parent, com.sun.source.tree.ExpressionTree tree, VisitorState state) ArrayToString.toStringFix
(com.sun.source.tree.Tree parent, com.sun.source.tree.ExpressionTree tree, VisitorState state) LiteProtoToString.toStringFix
(com.sun.source.tree.Tree parent, com.sun.source.tree.ExpressionTree tree, VisitorState state) ObjectToString.toStringFix
(com.sun.source.tree.Tree parent, com.sun.source.tree.ExpressionTree tree, VisitorState state) StreamToString.toStringFix
(com.sun.source.tree.Tree parent, com.sun.source.tree.ExpressionTree tree, VisitorState state) SymbolToString.toStringFix
(com.sun.source.tree.Tree parent, com.sun.source.tree.ExpressionTree tree, VisitorState state) TreeToString.toStringFix
(com.sun.source.tree.Tree parent, com.sun.source.tree.ExpressionTree tree, VisitorState state) TypeToString.toStringFix
(com.sun.source.tree.Tree parent, com.sun.source.tree.ExpressionTree tree, VisitorState state) static @Nullable StaticImports.StaticImportInfo
StaticImports.tryCreate
(com.sun.source.tree.ImportTree tree, VisitorState state) Returns aStaticImports.StaticImportInfo
if the given import is a static single-type import.static @Nullable StaticImports.StaticImportInfo
StaticImports.tryCreate
(com.sun.source.tree.MemberSelectTree access, VisitorState state) AssertThrowsUtils.tryFailToAssertThrows
(com.sun.source.tree.TryTree tryTree, List<? extends com.sun.source.tree.StatementTree> throwingStatements, Optional<com.sun.source.tree.Tree> failureMessage, VisitorState state) Transforms a try-catch block in the try-fail pattern into a call to JUnit'sassertThrows
, inserting the behavior of thetry
block into a lambda parameter, and assigning the expected exception to a variable, if it is used within thecatch
block. -
Uses of VisitorState in com.google.errorprone.bugpatterns.android
Modifier and TypeMethodDescriptionprotected Description
RectIntersectReturnValueIgnored.describeReturnValueIgnored
(com.sun.source.tree.MethodInvocationTree methodInvocationTree, VisitorState state) FragmentInjection.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) FragmentNotInstantiable.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) ParcelableCreator.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) HardCodedSdCardPath.matchLiteral
(com.sun.source.tree.LiteralTree tree, VisitorState state) MislabeledAndroidString.matchMemberSelect
(com.sun.source.tree.MemberSelectTree tree, VisitorState state) StaticOrDefaultInterfaceMethod.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) BinderIdentityRestoredDangerously.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) IsLoggableTagLength.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) WakelockReleasedDangerously.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) BundleDeserializationCast.matchTypeCast
(com.sun.source.tree.TypeCastTree tree, VisitorState state) -
Uses of VisitorState in com.google.errorprone.bugpatterns.apidiff
Modifier and TypeMethodDescriptionprotected Description
AndroidJdkLibsChecker.check
(com.sun.source.tree.ExpressionTree tree, VisitorState state) protected Description
ApiDiffChecker.check
(com.sun.source.tree.ExpressionTree tree, VisitorState state) ApiDiffChecker.matchIdentifier
(com.sun.source.tree.IdentifierTree tree, VisitorState state) ApiDiffChecker.matchMemberSelect
(com.sun.source.tree.MemberSelectTree tree, VisitorState state) -
Uses of VisitorState in com.google.errorprone.bugpatterns.argumentselectiondefects
Modifier and TypeMethodDescriptionArgumentSelectionDefectChecker.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) AssertEqualsArgumentOrderChecker.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ArgumentSelectionDefectChecker.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) AutoValueConstructorOrderChecker.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) -
Uses of VisitorState in com.google.errorprone.bugpatterns.checkreturnvalue
Modifier and TypeClassDescriptionfinal class
A rule that enables checking for methods belonging to a set of packages or any of their subpackages.Modifier and TypeMethodDescriptionstatic ResultUseRule
<VisitorState, com.sun.tools.javac.code.Symbol> AutoValueRules.autoBuilders()
Returns a rule forabstract
methods on@AutoBuilder
types.static ResultUseRule
<VisitorState, com.sun.tools.javac.code.Symbol> AutoValueRules.autoValueBuilders()
Returns a rule forabstract
methods on@AutoValue.Builder
types.static ResultUseRule
<VisitorState, com.sun.tools.javac.code.Symbol> AutoValueRules.autoValues()
Returns a rule forabstract
methods on@AutoValue
types.static ResultUseRule
<VisitorState, com.sun.tools.javac.code.Symbol> DaggerRules.componentBuilders()
Returns a rule that handles@dagger.Component.Builder
types, making their fluent setter methods' results ignorable.static ResultUseRule
<VisitorState, com.sun.tools.javac.code.Symbol> ExternalCanIgnoreReturnValue.externalIgnoreList()
Returns a rule using an external list of APIs to ignore.static ResultUseRule
<VisitorState, com.sun.tools.javac.code.Symbol> Rules.globalDefault
(Optional<ResultUsePolicy> methodDefault, Optional<ResultUsePolicy> constructorDefault) Returns a simple global rule that always returns the given defaults for methods and constructors.static ResultUseRule
<VisitorState, com.sun.tools.javac.code.Symbol> Rules.mapAnnotationSimpleName
(String simpleName, ResultUsePolicy policy) static ResultUseRule
<VisitorState, com.sun.tools.javac.code.Symbol> ProtoRules.mutableProtos()
Returns a rule that handles mutable protos, making their fluent setter methods' results ignorable.static ResultUseRule
<VisitorState, com.sun.tools.javac.code.Symbol> DaggerRules.productionComponentBuilders()
Returns a rule that handles@dagger.producers.ProductionComponent.Builder
types, making their fluent setter methods' results ignorable.static ResultUseRule
<VisitorState, com.sun.tools.javac.code.Symbol> DaggerRules.productionSubcomponentBuilders()
Returns a rule that handles@dagger.producers.ProductionSubcomponent.Builder
types, making their fluent setter methods' results ignorable.static ResultUseRule
<VisitorState, com.sun.tools.javac.code.Symbol> ProtoRules.protoBuilders()
Returns a rule that handles proto builders, making their fluent setter methods' results ignorable.static ResultUseRule
<VisitorState, com.sun.tools.javac.code.Symbol> DaggerRules.subcomponentBuilders()
Returns a rule that handles@dagger.Subcomponent.Builder
types, making their fluent setter methods' results ignorable.Modifier and TypeMethodDescriptionPackagesRule.evaluate
(com.sun.tools.javac.code.Symbol symbol, VisitorState state) ExternalCanIgnoreReturnValue.evaluateMethod
(com.sun.tools.javac.code.Symbol.MethodSymbol method, VisitorState state) UnnecessarilyUsedValue.matchAssignment
(com.sun.source.tree.AssignmentTree assignmentTree, VisitorState state) NoCanIgnoreReturnValueOnClasses.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) UsingJsr305CheckReturnValue.matchImport
(com.sun.source.tree.ImportTree tree, VisitorState state) BuilderReturnThis.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) CanIgnoreReturnValueSuggester.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) UnnecessarilyUsedValue.matchVariable
(com.sun.source.tree.VariableTree variableTree, VisitorState state) -
Uses of VisitorState in com.google.errorprone.bugpatterns.collectionincompatibletype
Modifier and TypeMethodDescriptionstatic @Nullable AbstractCollectionIncompatibleTypeMatcher.MatchResult
ContainmentMatchers.firstNonNullMatchResult
(com.sun.source.tree.ExpressionTree tree, VisitorState state) CollectionIncompatibleType.match
(com.sun.source.tree.ExpressionTree tree, VisitorState state) CollectionUndefinedEquality.match
(com.sun.source.tree.ExpressionTree tree, VisitorState state) CompatibleWithMisuse.matchAnnotation
(com.sun.source.tree.AnnotationTree annoTree, VisitorState state) final @Nullable AbstractCollectionIncompatibleTypeMatcher.MatchResult
AbstractCollectionIncompatibleTypeMatcher.matches
(com.sun.source.tree.ExpressionTree tree, VisitorState state) CollectionIncompatibleType.matchMemberReference
(com.sun.source.tree.MemberReferenceTree tree, VisitorState state) CollectionUndefinedEquality.matchMemberReference
(com.sun.source.tree.MemberReferenceTree tree, VisitorState state) CollectionIncompatibleType.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) CollectionUndefinedEquality.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) IncompatibleArgumentType.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree methodInvocationTree, VisitorState state) JUnitIncompatibleType.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) TruthIncompatibleType.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) -
Uses of VisitorState in com.google.errorprone.bugpatterns.flogger
Modifier and TypeMethodDescriptionFloggerLogWithCause.matchCatch
(com.sun.source.tree.CatchTree tree, VisitorState state) FloggerRequiredModifiers.matchIdentifier
(com.sun.source.tree.IdentifierTree tree, VisitorState state) FloggerRedundantIsEnabled.matchIf
(com.sun.source.tree.IfTree ifTree, VisitorState state) FloggerRequiredModifiers.matchMemberSelect
(com.sun.source.tree.MemberSelectTree tree, VisitorState state) FloggerSplitLogStatement.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) FloggerArgumentToString.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) FloggerFormatString.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) FloggerLogString.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) FloggerLogVarargs.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) FloggerMessageFormat.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) FloggerRequiredModifiers.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) FloggerStringConcatenation.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) FloggerWithCause.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) FloggerWithoutCause.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) FloggerRequiredModifiers.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) FloggerSplitLogStatement.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) -
Uses of VisitorState in com.google.errorprone.bugpatterns.formatstring
Modifier and TypeMethodDescriptionstatic com.google.common.collect.ImmutableList
<com.sun.source.tree.ExpressionTree> FormatStringUtils.formatMethodArguments
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) InlineFormatString.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) FormatStringAnnotationChecker.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) FormatString.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) FormatStringAnnotationChecker.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) FormatStringAnnotationChecker.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) static @Nullable FormatStringValidation.ValidationResult
FormatStringValidation.validate
(@Nullable com.sun.tools.javac.code.Symbol.MethodSymbol formatMethodSymbol, Collection<? extends com.sun.source.tree.ExpressionTree> arguments, VisitorState state) static @Nullable FormatStringValidation.ValidationResult
StrictFormatStringValidation.validate
(com.sun.source.tree.ExpressionTree formatStringTree, List<? extends com.sun.source.tree.ExpressionTree> args, VisitorState state) -
Uses of VisitorState in com.google.errorprone.bugpatterns.inject
Modifier and TypeMethodDescriptionAssistedInjectAndInjectOnSameConstructor.matchAnnotation
(com.sun.source.tree.AnnotationTree annotationTree, VisitorState state) final Description
AutoFactoryAtInject.matchAnnotation
(com.sun.source.tree.AnnotationTree annotationTree, VisitorState state) JavaxInjectOnFinalField.matchAnnotation
(com.sun.source.tree.AnnotationTree annotationTree, VisitorState state) MoreThanOneInjectableConstructor.matchAnnotation
(com.sun.source.tree.AnnotationTree tree, VisitorState state) MoreThanOneQualifier.matchAnnotation
(com.sun.source.tree.AnnotationTree annotationTree, VisitorState state) final Description
ScopeAnnotationOnInterfaceOrAbstractClass.matchAnnotation
(com.sun.source.tree.AnnotationTree annotationTree, VisitorState state) final Description
AssistedInjectAndInjectOnConstructors.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) final Description
InjectOnMemberAndConstructor.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) final Description
InvalidTargetingOnScopingAnnotation.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) final Description
MissingRuntimeRetention.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) final Description
MoreThanOneScopeAnnotationOnClass.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) final Description
OverlappingQualifierAndScopeAnnotation.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) QualifierWithTypeUse.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) CloseableProvides.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) InjectedConstructorAnnotations.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) Matches injected constructors annotated with @Inject(optional=true) or binding annotations.InjectOnConstructorOfAbstractClass.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) JavaxInjectOnAbstractMethod.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) MisplacedScopeAnnotations.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) QualifierOrScopeOnInjectMethod.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) MisplacedScopeAnnotations.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) -
Uses of VisitorState in com.google.errorprone.bugpatterns.inject.dagger
Modifier and TypeMethodDescriptionPrivateConstructorForNoninstantiableModule.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) ScopeOnModule.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) AndroidInjectionBeforeSuper.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) EmptySetMultibindingContributions.matchMethod
(com.sun.source.tree.MethodTree method, VisitorState state) UseBinds.matchMethod
(com.sun.source.tree.MethodTree method, VisitorState state) RefersToDaggerCodegen.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ProvidesNull.matchReturn
(com.sun.source.tree.ReturnTree returnTree, VisitorState state) Matches explicit "return null" statements in methods annotated with@Provides
but not@Nullable
. -
Uses of VisitorState in com.google.errorprone.bugpatterns.inject.guice
Modifier and TypeMethodDescriptionProvidesMethodOutsideOfModule.matchAnnotation
(com.sun.source.tree.AnnotationTree annotation, VisitorState state) final Description
AssistedInjectScoping.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) final Description
AssistedParameters.matchMethod
(com.sun.source.tree.MethodTree constructor, VisitorState state) BindingToUnqualifiedCommonType.matchMethod
(com.sun.source.tree.MethodTree method, VisitorState state) OverridesGuiceInjectableMethod.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) OverridesJavaxInjectableMethod.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) BindingToUnqualifiedCommonType.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree methodInvocation, VisitorState state) InjectOnFinalField.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) -
Uses of VisitorState in com.google.errorprone.bugpatterns.inlineme
Modifier and TypeMethodDescriptionInliner.matchMemberReference
(com.sun.source.tree.MemberReferenceTree tree, VisitorState state) Suggester.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) Validator.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) Inliner.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) Inliner.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) -
Uses of VisitorState in com.google.errorprone.bugpatterns.javadoc
Modifier and TypeMethodDescriptionEmptyBlockTag.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) EscapedEntity.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) InheritDoc.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) InvalidBlockTag.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) InvalidInlineTag.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) InvalidLink.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) InvalidParam.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) MalformedInlineTag.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) MissingSummary.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) UnescapedEntity.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) UnrecognisedJavadocTag.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) UrlInSee.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) AlmostJavadoc.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) NotJavadoc.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) EmptyBlockTag.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) EscapedEntity.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) InheritDoc.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) InvalidBlockTag.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) InvalidInlineTag.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) InvalidLink.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) InvalidParam.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) InvalidThrows.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) InvalidThrowsLink.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) MalformedInlineTag.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) MissingSummary.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) ReturnFromVoid.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) UnescapedEntity.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) UnrecognisedJavadocTag.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) UrlInSee.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) EmptyBlockTag.matchVariable
(com.sun.source.tree.VariableTree variableTree, VisitorState state) EscapedEntity.matchVariable
(com.sun.source.tree.VariableTree variableTree, VisitorState state) InheritDoc.matchVariable
(com.sun.source.tree.VariableTree variableTree, VisitorState state) InvalidBlockTag.matchVariable
(com.sun.source.tree.VariableTree variableTree, VisitorState state) InvalidInlineTag.matchVariable
(com.sun.source.tree.VariableTree variableTree, VisitorState state) InvalidLink.matchVariable
(com.sun.source.tree.VariableTree variableTree, VisitorState state) MalformedInlineTag.matchVariable
(com.sun.source.tree.VariableTree variableTree, VisitorState state) MissingSummary.matchVariable
(com.sun.source.tree.VariableTree variableTree, VisitorState state) UnescapedEntity.matchVariable
(com.sun.source.tree.VariableTree variableTree, VisitorState state) UnrecognisedJavadocTag.matchVariable
(com.sun.source.tree.VariableTree variableTree, VisitorState state) UrlInSee.matchVariable
(com.sun.source.tree.VariableTree variableTree, VisitorState state) -
Uses of VisitorState in com.google.errorprone.bugpatterns.nullness
Modifier and TypeMethodDescriptionMultipleNullnessAnnotations.matchAnnotatedType
(com.sun.source.tree.AnnotatedTypeTree tree, VisitorState state) NullablePrimitive.matchAnnotatedType
(com.sun.source.tree.AnnotatedTypeTree tree, VisitorState state) NullableWildcard.matchAnnotatedType
(com.sun.source.tree.AnnotatedTypeTree tree, VisitorState state) FieldMissingNullable.matchAssignment
(com.sun.source.tree.AssignmentTree tree, VisitorState state) UnsafeWildcard.matchAssignment
(com.sun.source.tree.AssignmentTree tree, VisitorState state) FieldMissingNullable.matchBinary
(com.sun.source.tree.BinaryTree tree, VisitorState state) ParameterMissingNullable.matchBinary
(com.sun.source.tree.BinaryTree tree, VisitorState state) UnsafeWildcard.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) ReturnMissingNullable.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState stateForCompilationUnit) UnsafeWildcard.matchConditionalExpression
(com.sun.source.tree.ConditionalExpressionTree tree, VisitorState state) UnsafeWildcard.matchLambdaExpression
(com.sun.source.tree.LambdaExpressionTree tree, VisitorState state) DereferenceWithNullBranch.matchMemberSelect
(com.sun.source.tree.MemberSelectTree select, VisitorState state) EqualsBrokenForNull.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) EqualsMissingNullable.matchMethod
(com.sun.source.tree.MethodTree methodTree, VisitorState state) MultipleNullnessAnnotations.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) NullablePrimitive.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) NullablePrimitiveArray.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) VoidMissingNullable.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) NullArgumentForNonNullParameter.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ParameterMissingNullable.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) UnnecessaryCheckNotNull.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) UnsafeWildcard.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) NullArgumentForNonNullParameter.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) ParameterMissingNullable.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) UnsafeWildcard.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) VoidMissingNullable.matchParameterizedType
(com.sun.source.tree.ParameterizedTypeTree parameterizedTypeTree, VisitorState state) UnsafeWildcard.matchParenthesized
(com.sun.source.tree.ParenthesizedTree tree, VisitorState state) UnsafeWildcard.matchReturn
(com.sun.source.tree.ReturnTree tree, VisitorState state) UnsafeWildcard.matchTypeCast
(com.sun.source.tree.TypeCastTree tree, VisitorState state) ExtendsObject.matchTypeParameter
(com.sun.source.tree.TypeParameterTree tree, VisitorState state) NullableTypeParameter.matchTypeParameter
(com.sun.source.tree.TypeParameterTree tree, VisitorState state) FieldMissingNullable.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) MultipleNullnessAnnotations.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) NullablePrimitive.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) NullablePrimitiveArray.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) UnsafeWildcard.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) VoidMissingNullable.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) -
Uses of VisitorState in com.google.errorprone.bugpatterns.overloading
Modifier and TypeMethodDescriptionInconsistentOverloads.matchClass
(com.sun.source.tree.ClassTree classTree, VisitorState state) -
Uses of VisitorState in com.google.errorprone.bugpatterns.threadsafety
Modifier and TypeMethodDescriptionstatic void
HeldLockAnalyzer.analyze
(VisitorState state, HeldLockAnalyzer.LockEventListener listener, Predicate<com.sun.source.tree.Tree> isSuppressed, GuardedByFlags flags) Analyzes a method body, tracking the set of held locks and checking accesses to guarded members.static Optional
<GuardedByExpression> GuardedByBinder.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 @Nullable com.sun.tools.javac.code.Symbol
GuardedByUtils.bindGuardedByString
(com.sun.source.tree.Tree tree, String guard, VisitorState visitorState, GuardedByFlags flags) ThreadSafety.Builder.build
(VisitorState state) protected Description
GuardedByChecker.checkGuardedAccess
(com.sun.source.tree.Tree tree, GuardedByExpression guard, com.google.errorprone.bugpatterns.threadsafety.HeldLockSet locks, VisitorState state) ConstantExpressions.constantExpression
(com.sun.source.tree.ExpressionTree tree, VisitorState state) static GuardedBySymbolResolver
GuardedBySymbolResolver.from
(com.sun.source.tree.Tree tree, VisitorState visitorState) static GuardedBySymbolResolver
GuardedBySymbolResolver.from
(com.sun.tools.javac.code.Symbol.ClassSymbol owner, com.google.errorprone.bugpatterns.threadsafety.GuardedBySymbolResolver.MethodInfo method, com.sun.source.tree.CompilationUnitTree compilationUnit, com.sun.tools.javac.util.Context context, com.sun.source.tree.Tree leaf, VisitorState visitorState) static Optional
<GuardedByExpression> HeldLockAnalyzer.ExpectedLockCalculator.from
(com.sun.tools.javac.tree.JCTree.JCExpression guardedMemberExpression, GuardedByExpression guard, VisitorState state, GuardedByFlags flags) Determine the lock expression that needs to be held when accessing a specific guarded member.ThreadSafety.getInheritedAnnotation
(com.sun.tools.javac.code.Symbol sym, VisitorState state) Gets the possibly inherited marker annotation on the given symbol, and reverse-propagates containerOf spec's from super-classes.ThreadSafety.getMarkerOrAcceptedAnnotation
(com.sun.tools.javac.code.Symbol sym, VisitorState state) Gets theSymbol
's annotation info, either from a marker annotation on the symbol, from an accepted annotation on the symbol, or from the list of well-known types.static boolean
WellKnownMutability.isAnnotation
(VisitorState state, com.sun.tools.javac.code.Type type) Returns true if the type is an annotation.static com.google.errorprone.bugpatterns.threadsafety.GuardedByUtils.GuardedByValidationResult
GuardedByUtils.isGuardedByValid
(com.sun.source.tree.Tree tree, VisitorState state, GuardedByFlags flags) static boolean
WellKnownMutability.isProto2MessageClass
(VisitorState state, com.sun.tools.javac.code.Type type) Compile-time equivalent ofcom.google.io.protocol.ProtocolSupport#isProto2MessageClass
.static boolean
WellKnownMutability.isProto2MutableMessageClass
(VisitorState state, com.sun.tools.javac.code.Type type) Compile-time equivalent ofcom.google.io.protocol.ProtocolSupport#isProto2MutableMessageClass
.static boolean
WellKnownMutability.isProtoEnum
(VisitorState state, com.sun.tools.javac.code.Type type) ImmutableAnnotationChecker.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) ImmutableChecker.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) ImmutableEnumChecker.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) ThreadSafeChecker.matchClass
(com.sun.source.tree.ClassTree tree, VisitorState state) ImmutableRefactoring.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) DoubleCheckedLocking.matchIf
(com.sun.source.tree.IfTree outerIf, VisitorState state) GuardedByChecker.matchLambdaExpression
(com.sun.source.tree.LambdaExpressionTree tree, VisitorState state) ImmutableChecker.matchLambdaExpression
(com.sun.source.tree.LambdaExpressionTree tree, VisitorState state) GuardedByChecker.matchMemberReference
(com.sun.source.tree.MemberReferenceTree tree, VisitorState state) ImmutableChecker.matchMemberReference
(com.sun.source.tree.MemberReferenceTree tree, VisitorState state) ThreadSafeChecker.matchMemberReference
(com.sun.source.tree.MemberReferenceTree tree, VisitorState state) GuardedByChecker.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) ImmutableChecker.matchMethod
(com.sun.source.tree.MethodTree tree, VisitorState state) ImmutableChecker.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ThreadPriorityCheck.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ThreadSafeChecker.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ImmutableChecker.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) ThreadSafeChecker.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) StaticGuardedByInstance.matchSynchronized
(com.sun.source.tree.SynchronizedTree tree, VisitorState state) SynchronizeOnNonFinalField.matchSynchronized
(com.sun.source.tree.SynchronizedTree tree, VisitorState state) ThreadSafeChecker.matchTypeParameter
(com.sun.source.tree.TypeParameterTree tree, VisitorState state) GuardedByChecker.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) ConstantExpressions.symbolizeImmutableExpression
(com.sun.source.tree.ExpressionTree tree, VisitorState state) Returns a list of the methods called to get to this expression, as well as a terminating variable if needed.ConstantExpressions.truthiness
(com.sun.source.tree.ExpressionTree tree, boolean not, VisitorState state) Scans anExpressionTree
to find anything guaranteed to be false or true if this expression is true.ModifierConstructorDescriptionThreadSafeAnalysis
(BugChecker bugChecker, VisitorState state, WellKnownThreadSafety wellKnownThreadSafety) -
Uses of VisitorState in com.google.errorprone.bugpatterns.time
Modifier and TypeMethodDescriptionTimeUnitMismatch.matchAssignment
(com.sun.source.tree.AssignmentTree tree, VisitorState state) TimeUnitMismatch.matchBinary
(com.sun.source.tree.BinaryTree tree, VisitorState state) StronglyTypeTime.matchCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState state) JodaDateTimeConstants.matchIdentifier
(com.sun.source.tree.IdentifierTree tree, VisitorState state) JodaDateTimeConstants.matchMemberSelect
(com.sun.source.tree.MemberSelectTree tree, VisitorState state) DateChecker.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) DurationFrom.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) DurationGetTemporalUnit.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) DurationTemporalUnit.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) DurationToLongTimeUnit.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) FromTemporalAccessor.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) InstantTemporalUnit.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) InvalidJavaTimeConstant.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) JavaDurationGetSecondsGetNano.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) JavaDurationGetSecondsToToSeconds.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) JavaDurationWithNanos.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) JavaDurationWithSeconds.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) JavaInstantGetSecondsGetNano.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) JavaLocalDateTimeGetNano.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) JavaLocalTimeGetNano.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) JavaPeriodGetDays.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) JavaTimeDefaultTimeZone.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) JodaDurationWithMillis.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) JodaInstantWithMillis.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) JodaNewPeriod.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) JodaPlusMinusLong.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) JodaTimeConverterManager.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) JodaToSelf.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) JodaWithDurationAddedLong.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) LocalDateTemporalAmount.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) PeriodFrom.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) PeriodGetTemporalUnit.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) PeriodTimeMath.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) PreferJavaTimeOverload.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ProtoDurationGetSecondsGetNano.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ProtoTimestampGetSecondsGetNano.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) TemporalAccessorGetChronoField.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) TimeUnitConversionChecker.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) TimeUnitMismatch.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) ZoneIdOfZ.matchMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) DateChecker.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) JodaConstructors.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) JodaToSelf.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) TimeUnitMismatch.matchNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState state) TimeUnitMismatch.matchVariable
(com.sun.source.tree.VariableTree tree, VisitorState state) -
Uses of VisitorState in com.google.errorprone.fixes
Modifier and TypeMethodDescriptionstatic Optional
<SuggestedFix> SuggestedFixes.addMembers
(com.sun.source.tree.ClassTree classTree, VisitorState state, SuggestedFixes.AdditionPosition where, Iterable<String> members) static SuggestedFix
SuggestedFixes.addMembers
(com.sun.source.tree.ClassTree classTree, VisitorState state, SuggestedFixes.AdditionPosition where, String firstMember, String... otherMembers) Returns aFix
that adds members defined byfirstMember
(and optionallyotherMembers
) to the class referenced byclassTree
.static SuggestedFix
SuggestedFixes.addMembers
(com.sun.source.tree.ClassTree classTree, VisitorState state, String firstMember, String... otherMembers) Returns aFix
that adds members defined byfirstMember
(and optionallyotherMembers
) to the end of the class referenced byclassTree
.static Optional
<SuggestedFix> SuggestedFixes.addModifiers
(com.sun.source.tree.Tree tree, VisitorState state, Modifier... modifiers) Adds modifiers to the given class, method, or field declaration.static Optional
<SuggestedFix> SuggestedFixes.addModifiers
(com.sun.source.tree.Tree tree, com.sun.source.tree.ModifiersTree originalModifiers, VisitorState state, Set<Modifier> modifiers) Adds modifiers to the given declaration and corresponding modifiers tree.static void
SuggestedFixes.addSuppressWarnings
(SuggestedFix.Builder fixBuilder, VisitorState state, String warningToSuppress) ModifiesfixBuilder
to either create a new@SuppressWarnings
element on the closest suppressible node, or addwarningToSuppress
to that node if there's already aSuppressWarnings
annotation there.static void
SuggestedFixes.addSuppressWarnings
(SuggestedFix.Builder fixBuilder, VisitorState state, String warningToSuppress, @Nullable String lineComment) ModifiesfixBuilder
to either create a new@SuppressWarnings
element on the closest suppressible node, or addwarningToSuppress
to that node if there's already aSuppressWarnings
annotation there.static void
SuggestedFixes.addSuppressWarnings
(SuggestedFix.Builder fixBuilder, VisitorState state, String warningToSuppress, @Nullable String lineComment, boolean commentOnNewLine) ModifiesfixBuilder
to either create a new@SuppressWarnings
element on the closest suppressible node, or addwarningToSuppress
to that node if there's already aSuppressWarnings
annotation there.static SuggestedFix
SuggestedFixes.addSuppressWarnings
(VisitorState state, String warningToSuppress) Returns a fix that adds a@SuppressWarnings(warningToSuppress)
to the closest suppressible element to the node pointed at bystate.getPath()
.static SuggestedFix
SuggestedFixes.addSuppressWarnings
(VisitorState state, String warningToSuppress, @Nullable String lineComment) Returns a fix that adds a@SuppressWarnings(warningToSuppress)
to the closest suppressible element to the node pointed at bystate.getPath()
, optionally suffixing the suppression with a comment suffix (e.g.static SuggestedFix.Builder
SuggestedFixes.addValuesToAnnotationArgument
(com.sun.source.tree.AnnotationTree annotation, String parameterName, Collection<String> newValues, VisitorState state) Returns a fix that appendsnewValues
to theparameterName
argument forannotation
, regardless of whether there is already an argument.static String
SuggestedFixes.castTree
(com.sun.source.tree.ExpressionTree expressionTree, String toType, VisitorState state) Casts the givenexpressionTree
totoType
, adding parentheses if necessary.static boolean
SuggestedFixes.compilesWithFix
(Fix fix, VisitorState state) Returns true if the current compilation would succeed with the given fix applied.static boolean
SuggestedFixes.compilesWithFix
(Fix fix, VisitorState state, com.google.common.collect.ImmutableList<String> extraOptions, boolean onlyInSameCompilationUnit) Returns true if the current compilation would succeed with the given fix applied, using the given additional compiler options, optionally limiting the checking of compilation failures to the compilation unit in which the fix is applied.static SuggestedFixes.FixCompiler
SuggestedFixes.FixCompiler.create
(Fix fix, VisitorState state) static Fix
SuggestedFixes.deleteExceptions
(com.sun.source.tree.MethodTree tree, VisitorState state, List<com.sun.source.tree.ExpressionTree> toDelete) Deletes the given exceptions from a method's throws clause.static URI
SuggestedFixes.FixCompiler.getModifiedFileUri
(VisitorState state) static String
SuggestedFixes.prettyType
(@Nullable VisitorState state, @Nullable SuggestedFix.Builder existingFix, com.sun.tools.javac.code.Type type) Pretty-prints a Type for use in fixes, qualifying any enclosed type names usingSuggestedFixes.qualifyType(com.google.errorprone.VisitorState, com.google.errorprone.fixes.SuggestedFix.Builder, com.sun.tools.javac.code.Symbol)
}.static String
SuggestedFixes.prettyType
(com.sun.tools.javac.code.Type type, @Nullable VisitorState state) Pretty-prints a Type for use in diagnostic messages, qualifying any enclosed type names usingSuggestedFixes.qualifyType(com.google.errorprone.VisitorState, com.google.errorprone.fixes.SuggestedFix.Builder, com.sun.tools.javac.code.Symbol)
}.static void
SuggestedFixes.qualifyDocReference
(SuggestedFix.Builder fix, com.sun.source.util.DocTreePath docPath, VisitorState state) Fully qualifies a javadoc reference, e.g.static String
SuggestedFixes.qualifyStaticImport
(String qualifiedName, SuggestedFix.Builder fix, VisitorState state) Provides a name to use for the (fully qualified) method provided inqualifiedName
, trying to static import it if possible.static String
SuggestedFixes.qualifyType
(VisitorState state, SuggestedFix.Builder fix, com.sun.tools.javac.code.Symbol sym) Returns a human-friendly name of the givenSymbol
for use in fixes.static String
SuggestedFixes.qualifyType
(VisitorState state, SuggestedFix.Builder fix, String typeName) Returns a human-friendly name of the giventypeName
for use in fixes.static String
SuggestedFixes.qualifyType
(VisitorState state, SuggestedFix.Builder fix, TypeMirror type) Returns a human-friendly name of the given type for use in fixes.static SuggestedFix
SuggestedFixes.removeElement
(com.sun.source.tree.Tree tree, List<? extends com.sun.source.tree.Tree> trees, VisitorState state) Removestree
fromtrees
, assuming thattrees
represents a comma-separated list of expressions containingtree
.static Optional
<SuggestedFix> SuggestedFixes.removeModifiers
(com.sun.source.tree.ModifiersTree originalModifiers, VisitorState state, Set<Modifier> toRemove) Removes modifiers to the given declaration and corresponding modifiers tree.static Optional
<SuggestedFix> SuggestedFixes.removeModifiers
(com.sun.source.tree.Tree tree, VisitorState state, Modifier... modifiers) Removes modifiers from the given class, method, or field declaration.static void
SuggestedFixes.removeSuppressWarnings
(SuggestedFix.Builder fixBuilder, VisitorState state, String warningToRemove) ModifiesfixBuilder
to either remove awarningToRemove
warning from the closestSuppressWarning
node or remove the entireSuppressWarning
node ifwarningToRemove
is the only warning in that node.static SuggestedFix
SuggestedFixes.renameMethod
(com.sun.source.tree.MethodTree tree, String replacement, VisitorState state) Be warned, only changes method name at the declaration.static SuggestedFix
SuggestedFixes.renameMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, String replacement, VisitorState state) Replaces the name of the method being invoked intree
withreplacement
.static SuggestedFix
SuggestedFixes.renameMethodWithInvocations
(com.sun.source.tree.MethodTree tree, String replacement, VisitorState state) Renames the givenMethodTree
and its usages in the current compilation unit toreplacement
.static SuggestedFix
SuggestedFixes.renameTypeParameter
(com.sun.source.tree.TypeParameterTree typeParameter, com.sun.source.tree.Tree owningTree, String typeVarReplacement, VisitorState state) Renames a type parametertypeParameter
owned byowningTree
totypeVarReplacement
.static SuggestedFix
SuggestedFixes.renameVariable
(com.sun.source.tree.VariableTree tree, String replacement, VisitorState state) Renames the givenVariableTree
and its usages in the current compilation unit toreplacement
.static SuggestedFix
SuggestedFixes.renameVariableUsages
(com.sun.source.tree.VariableTree tree, String replacement, VisitorState state) Renames usage of the givenVariableTree
in the current compilation unit toreplacement
.static SuggestedFix
SuggestedFixes.replaceIncludingComments
(com.sun.source.util.TreePath path, String replacement, VisitorState state) Replaces the tree atpath
along with any Javadocs/associated single-line comments.static Optional
<SuggestedFix> SuggestedFixes.suggestExemptingAnnotation
(String exemptingAnnotation, com.sun.source.util.TreePath where, VisitorState state) Create a fix to add a suppression annotation on the surrounding class.static SuggestedFix.Builder
SuggestedFixes.updateAnnotationArgumentValues
(com.sun.source.tree.AnnotationTree annotation, VisitorState state, String parameterName, Collection<String> newValues) Returns a fix that updatesnewValues
to theparameterName
argument forannotation
, regardless of whether there is already an argument. -
Uses of VisitorState in com.google.errorprone.matchers
Modifier and TypeMethodDescriptionstatic boolean
UnusedReturnValueMatcher.expectedExceptionTest
(VisitorState state) Allow return values to be ignored in tests that expect an exception to be thrown.UnusedReturnValueMatcher.getAllowReasons
(com.sun.source.tree.ExpressionTree tree, VisitorState state) Returns a stream of reasons the given expression is allowed to have an unused return value based on its context.protected Iterable
<? extends com.sun.source.tree.AnnotationTree> AnnotationMatcher.getChildNodes
(T tree, VisitorState state) ChildMultiMatcher.getChildNodes
(T tree, VisitorState state) Returns the set of child nodes to match.protected Iterable
<? extends com.sun.source.tree.MethodTree> ConstructorOfClass.getChildNodes
(com.sun.source.tree.ClassTree classTree, VisitorState state) protected Iterable
<? extends com.sun.source.tree.ExpressionTree> HasArguments.getChildNodes
(com.sun.source.tree.MethodInvocationTree methodInvocationTree, VisitorState state) protected Iterable
<? extends com.sun.source.tree.VariableTree> MethodHasParameters.getChildNodes
(com.sun.source.tree.MethodTree methodTree, VisitorState state) static boolean
CompileTimeConstantExpressionMatcher.hasCompileTimeConstantAnnotation
(VisitorState state, com.sun.tools.javac.code.Symbol symbol) static boolean
JUnitMatchers.hasJUnitAnnotation
(com.sun.source.tree.MethodTree tree, VisitorState state) Checks if a method, or any overridden method, is annotated with any annotation from the org.junit package.static boolean
TestNgMatchers.hasTestNgAnnotation
(com.sun.source.tree.MethodTree tree, VisitorState state) Checks if a method, or any overridden method, is annotated with any annotation from the org.testng package.boolean
UnusedReturnValueMatcher.isAllowed
(com.sun.source.tree.ExpressionTree tree, VisitorState state) Returnstrue
if the given expression is allowed to have an unused return value based on its context.static boolean
UnusedReturnValueMatcher.isReturnValueUnused
(com.sun.source.tree.ExpressionTree tree, VisitorState state) Returnstrue
if and only if the giventree
is an invocation of or reference to a constructor or non-void
method for which the return value is considered unused.static boolean
Matchers.isThrowingFunctionalInterface
(com.sun.tools.javac.code.Type clazzType, VisitorState state) abstract boolean
AbstractTypeMatcher.matches
(T tree, VisitorState state) boolean
AnnotationDoesNotHaveArgument.matches
(com.sun.source.tree.AnnotationTree annotationTree, VisitorState state) boolean
AnnotationHasArgumentWithValue.matches
(com.sun.source.tree.AnnotationTree annotationTree, VisitorState state) boolean
AnnotationType.matches
(com.sun.source.tree.AnnotationTree annotationTree, VisitorState state) boolean
Asserts.matches
(com.sun.source.tree.StatementTree statementTree, VisitorState state) boolean
ChildMultiMatcher.matches
(T tree, VisitorState state) boolean
CompileTimeConstantExpressionMatcher.matches
(com.sun.source.tree.ExpressionTree t, VisitorState state) boolean
CompoundAssignment.matches
(com.sun.source.tree.CompoundAssignmentTree compoundAssignmentTree, VisitorState state) boolean
Contains.matches
(com.sun.source.tree.Tree tree, VisitorState state) boolean
Enclosing.BlockOrCase.matches
(T unused, VisitorState state) boolean
HasIdentifier.matches
(com.sun.source.tree.Tree tree, VisitorState state) boolean
IsNonNullMatcher.matches
(com.sun.source.tree.ExpressionTree tree, VisitorState state) boolean
IsSameType.matches
(T tree, VisitorState state) boolean
IsSubtypeOf.matches
(T tree, VisitorState state) boolean
Matcher.matches
(T t, VisitorState state) boolean
MethodInvocation.matches
(com.sun.source.tree.ExpressionTree expressionTree, VisitorState state) boolean
MethodInvocationArgument.matches
(com.sun.source.tree.MethodInvocationTree methodInvocationTree, VisitorState state) boolean
MethodVisibility.matches
(com.sun.source.tree.MethodTree t, VisitorState state) boolean
NullnessMatcher.matches
(com.sun.source.tree.ExpressionTree expr, VisitorState state) boolean
Returns.matches
(com.sun.source.tree.StatementTree expressionTree, VisitorState state) boolean
StringLiteral.matches
(com.sun.source.tree.ExpressionTree expressionTree, VisitorState state) boolean
Throws.matches
(com.sun.source.tree.StatementTree expressionTree, VisitorState state) boolean
UnusedReturnValueMatcher.matches
(com.sun.source.tree.ExpressionTree tree, VisitorState state) static boolean
Matchers.methodCallInDeclarationOfThrowingRunnable
(VisitorState state) static boolean
UnusedReturnValueMatcher.mockitoInvocation
(com.sun.source.tree.Tree tree, VisitorState state) Don't match the method that is invoked throughMockito.verify(t)
ordoReturn(val).when(t)
.ChildMultiMatcher.multiMatchResult
(T tree, VisitorState state) MultiMatcher.multiMatchResult
(T tree, VisitorState vs) Attempt to match the given node, and return the associated subnodes that matched.boolean
Suppressible.suppressedByAnyOf
(Set<com.sun.tools.javac.util.Name> annotations, VisitorState s) Modifier and TypeMethodDescriptionstatic <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 byASTHelpers.getSymbol(Tree)
. -
Uses of VisitorState in com.google.errorprone.predicates
Modifier and TypeMethodDescriptionboolean
TypePredicate.apply
(com.sun.tools.javac.code.Type type, VisitorState state) -
Uses of VisitorState in com.google.errorprone.predicates.type
Modifier and TypeMethodDescriptionboolean
DescendantOf.apply
(com.sun.tools.javac.code.Type type, VisitorState state) boolean
DescendantOfAny.apply
(com.sun.tools.javac.code.Type type, VisitorState state) boolean
Exact.apply
(com.sun.tools.javac.code.Type type, VisitorState state) boolean
ExactAny.apply
(com.sun.tools.javac.code.Type type, VisitorState state) -
Uses of VisitorState in com.google.errorprone.scanner
Modifier and TypeClassDescriptionclass
TODO(eaftan): I'm worried about this performance of this code, specifically the part that handles SuppressWarnings.Modifier and TypeMethodDescriptionprotected Set
<? extends com.sun.tools.javac.util.Name> ErrorProneScanner.getCustomSuppressionAnnotations
(VisitorState state) protected Set
<? extends com.sun.tools.javac.util.Name> Scanner.getCustomSuppressionAnnotations
(VisitorState state) Returns a set of all the custom suppression annotation types used by theBugChecker
s in thisScanner
.protected SuppressionInfo.SuppressedState
Scanner.isSuppressed
(Suppressible suppressible, ErrorProneOptions errorProneOptions, VisitorState state) Returns if this checker should be suppressed on the current tree path.protected void
Scanner.reportMatch
(Description description, VisitorState state) Scanner.scan
(com.sun.source.tree.Tree tree, VisitorState state) Scan a single node.Scanner.scan
(com.sun.source.util.TreePath path, VisitorState state) Scan a tree from a position identified by a TreePath.ErrorProneScanner.visitAnnotatedType
(com.sun.source.tree.AnnotatedTypeTree tree, VisitorState visitorState) ErrorProneScanner.visitAnnotation
(com.sun.source.tree.AnnotationTree tree, VisitorState visitorState) ErrorProneScanner.visitArrayAccess
(com.sun.source.tree.ArrayAccessTree tree, VisitorState visitorState) ErrorProneScanner.visitArrayType
(com.sun.source.tree.ArrayTypeTree tree, VisitorState visitorState) ErrorProneScanner.visitAssert
(com.sun.source.tree.AssertTree tree, VisitorState visitorState) ErrorProneScanner.visitAssignment
(com.sun.source.tree.AssignmentTree tree, VisitorState visitorState) ErrorProneScanner.visitBinary
(com.sun.source.tree.BinaryTree tree, VisitorState visitorState) ErrorProneScanner.visitBlock
(com.sun.source.tree.BlockTree tree, VisitorState visitorState) ErrorProneScanner.visitBreak
(com.sun.source.tree.BreakTree tree, VisitorState visitorState) ErrorProneScanner.visitCase
(com.sun.source.tree.CaseTree tree, VisitorState visitorState) ErrorProneScanner.visitCatch
(com.sun.source.tree.CatchTree tree, VisitorState visitorState) ErrorProneScanner.visitClass
(com.sun.source.tree.ClassTree tree, VisitorState visitorState) ErrorProneScanner.visitCompilationUnit
(com.sun.source.tree.CompilationUnitTree tree, VisitorState visitorState) ErrorProneScanner.visitCompoundAssignment
(com.sun.source.tree.CompoundAssignmentTree tree, VisitorState visitorState) ErrorProneScanner.visitConditionalExpression
(com.sun.source.tree.ConditionalExpressionTree tree, VisitorState visitorState) ErrorProneScanner.visitContinue
(com.sun.source.tree.ContinueTree tree, VisitorState visitorState) ErrorProneScanner.visitDoWhileLoop
(com.sun.source.tree.DoWhileLoopTree tree, VisitorState visitorState) ErrorProneScanner.visitEmptyStatement
(com.sun.source.tree.EmptyStatementTree tree, VisitorState visitorState) ErrorProneScanner.visitEnhancedForLoop
(com.sun.source.tree.EnhancedForLoopTree tree, VisitorState visitorState) ErrorProneScanner.visitExpressionStatement
(com.sun.source.tree.ExpressionStatementTree tree, VisitorState visitorState) ErrorProneScanner.visitForLoop
(com.sun.source.tree.ForLoopTree tree, VisitorState visitorState) ErrorProneScanner.visitIdentifier
(com.sun.source.tree.IdentifierTree tree, VisitorState visitorState) ErrorProneScanner.visitIf
(com.sun.source.tree.IfTree tree, VisitorState visitorState) ErrorProneScanner.visitImport
(com.sun.source.tree.ImportTree tree, VisitorState visitorState) ErrorProneScanner.visitInstanceOf
(com.sun.source.tree.InstanceOfTree tree, VisitorState visitorState) ErrorProneScanner.visitIntersectionType
(com.sun.source.tree.IntersectionTypeTree tree, VisitorState visitorState) ErrorProneScanner.visitLabeledStatement
(com.sun.source.tree.LabeledStatementTree tree, VisitorState visitorState) ErrorProneScanner.visitLambdaExpression
(com.sun.source.tree.LambdaExpressionTree tree, VisitorState visitorState) ErrorProneScanner.visitLiteral
(com.sun.source.tree.LiteralTree tree, VisitorState visitorState) ErrorProneScanner.visitMemberReference
(com.sun.source.tree.MemberReferenceTree tree, VisitorState visitorState) ErrorProneScanner.visitMemberSelect
(com.sun.source.tree.MemberSelectTree tree, VisitorState visitorState) ErrorProneScanner.visitMethod
(com.sun.source.tree.MethodTree tree, VisitorState visitorState) ErrorProneScanner.visitMethodInvocation
(com.sun.source.tree.MethodInvocationTree tree, VisitorState visitorState) ErrorProneScanner.visitModifiers
(com.sun.source.tree.ModifiersTree tree, VisitorState visitorState) ErrorProneScanner.visitNewArray
(com.sun.source.tree.NewArrayTree tree, VisitorState visitorState) ErrorProneScanner.visitNewClass
(com.sun.source.tree.NewClassTree tree, VisitorState visitorState) ErrorProneScanner.visitParameterizedType
(com.sun.source.tree.ParameterizedTypeTree tree, VisitorState visitorState) ErrorProneScanner.visitParenthesized
(com.sun.source.tree.ParenthesizedTree tree, VisitorState visitorState) ErrorProneScanner.visitPrimitiveType
(com.sun.source.tree.PrimitiveTypeTree tree, VisitorState visitorState) ErrorProneScanner.visitReturn
(com.sun.source.tree.ReturnTree tree, VisitorState visitorState) ErrorProneScanner.visitSwitch
(com.sun.source.tree.SwitchTree tree, VisitorState visitorState) ErrorProneScanner.visitSynchronized
(com.sun.source.tree.SynchronizedTree tree, VisitorState visitorState) ErrorProneScanner.visitThrow
(com.sun.source.tree.ThrowTree tree, VisitorState visitorState) ErrorProneScanner.visitTry
(com.sun.source.tree.TryTree tree, VisitorState visitorState) ErrorProneScanner.visitTypeCast
(com.sun.source.tree.TypeCastTree tree, VisitorState visitorState) ErrorProneScanner.visitTypeParameter
(com.sun.source.tree.TypeParameterTree tree, VisitorState visitorState) ErrorProneScanner.visitUnary
(com.sun.source.tree.UnaryTree tree, VisitorState visitorState) ErrorProneScanner.visitUnionType
(com.sun.source.tree.UnionTypeTree tree, VisitorState visitorState) ErrorProneScanner.visitVariable
(com.sun.source.tree.VariableTree tree, VisitorState visitorState) ErrorProneScanner.visitWhileLoop
(com.sun.source.tree.WhileLoopTree tree, VisitorState visitorState) ErrorProneScanner.visitWildcard
(com.sun.source.tree.WildcardTree tree, VisitorState visitorState) -
Uses of VisitorState in com.google.errorprone.suppliers
-
Uses of VisitorState in com.google.errorprone.util
Modifier and TypeMethodDescriptionstatic Set
<com.sun.tools.javac.util.Name> ASTHelpers.annotationsAmong
(com.sun.tools.javac.code.Symbol sym, Set<? extends com.sun.tools.javac.util.Name> annotationClasses, VisitorState state) Determines which of a set of annotations are present on a symbol.static boolean
ASTHelpers.canBeRemoved
(com.sun.tools.javac.code.Symbol symbol, VisitorState state) Returns whether this symbol is safe to remove.static String
Signatures.classDescriptor
(com.sun.tools.javac.code.Type type, VisitorState state) Returns the binary names of the class.static boolean
ASTHelpers.containsComments
(com.sun.source.tree.Tree tree, VisitorState state) Returns whether the giventree
contains any comments in its source.static String
Signatures.descriptor
(com.sun.tools.javac.code.Type type, VisitorState state) Returns a JVMS 4.3.3 method descriptor.static com.google.common.collect.ImmutableList
<com.sun.tools.javac.code.Symbol.VarSymbol> FindIdentifiers.findAllFields
(com.sun.tools.javac.code.Type classType, VisitorState state) Finds all the visible fields declared or inherited in the target classstatic com.google.common.collect.ImmutableSet
<com.sun.tools.javac.code.Symbol.VarSymbol> FindIdentifiers.findAllIdents
(VisitorState state) Finds the set of all bare variable identifiers in scope at the current location.static @Nullable com.sun.source.tree.ClassTree
ASTHelpers.findClass
(com.sun.tools.javac.code.Symbol.ClassSymbol symbol, VisitorState state) Returns the class tree that matches the given symbol within the compilation unit, or null if none was found.static com.google.common.collect.ImmutableList
<Commented<com.sun.source.tree.ExpressionTree>> Comments.findCommentsForArguments
(com.sun.source.tree.MethodInvocationTree methodInvocationTree, VisitorState state) Attach comments to nodes on arguments of method calls.static com.google.common.collect.ImmutableList
<Commented<com.sun.source.tree.ExpressionTree>> Comments.findCommentsForArguments
(com.sun.source.tree.NewClassTree newClassTree, VisitorState state) Attach comments to nodes on arguments of constructor calls.static @Nullable com.sun.source.tree.MethodTree
ASTHelpers.findEnclosingMethod
(VisitorState state) Finds the enclosingMethodTree
.static com.sun.tools.javac.code.Symbol
FindIdentifiers.findIdent
(String name, VisitorState state) Finds a variable declaration with the given name that is in scope at the current location.static @Nullable com.sun.tools.javac.code.Symbol
FindIdentifiers.findIdent
(String name, VisitorState state, com.sun.tools.javac.code.Kinds.KindSelector kind) Finds a declaration with the given name and type that is in scope at the current location.static @Nullable com.sun.source.tree.MethodTree
ASTHelpers.findMethod
(com.sun.tools.javac.code.Symbol.MethodSymbol symbol, VisitorState state) Returns the method tree that matches the given symbol within the compilation unit, or null if none was found.static com.google.common.collect.ImmutableSet
<com.sun.tools.javac.code.Symbol.VarSymbol> FindIdentifiers.findUnusedIdentifiers
(VisitorState state) Finds all variable declarations which are unused at this point in the AST (i.e.static @Nullable com.sun.tools.javac.code.TypeAnnotations.AnnotationType
ASTHelpers.getAnnotationType
(com.sun.source.tree.AnnotationTree anno, @Nullable com.sun.tools.javac.code.Symbol target, VisitorState state) Returns whetheranno
corresponds to a type annotation, ornull
if it could not be determined.static com.google.common.collect.ImmutableSet
<String> ASTHelpers.getGeneratedBy
(VisitorState state) Returns the value of the@Generated
annotation on enclosing classes, if present.static com.google.common.collect.ImmutableSet
<String> ASTHelpers.getGeneratedBy
(com.sun.tools.javac.code.Symbol symbol, VisitorState state) Returns the values of the given symbol'sGenerated
annotations, if present.static Nullness
ASTHelpers.getNullnessValue
(com.sun.source.tree.ExpressionTree expr, VisitorState state, NullnessAnalysis nullnessAnalysis) Returns theNullness
for an expression as determined by the nullness dataflow analysis.static com.google.common.collect.ImmutableSet
<com.sun.tools.javac.code.Type> ASTHelpers.getThrownExceptions
(com.sun.source.tree.Tree tree, VisitorState state) Returns the exceptions thrown bytree
.static boolean
ASTHelpers.hasAnnotation
(com.sun.source.tree.Tree tree, Class<? extends Annotation> annotationClass, VisitorState state) Deprecated.static boolean
ASTHelpers.hasAnnotation
(com.sun.source.tree.Tree tree, String annotationClass, VisitorState state) Check for the presence of an annotation, considering annotation inheritance.static boolean
ASTHelpers.hasAnnotation
(com.sun.tools.javac.code.Symbol sym, Class<? extends Annotation> annotationClass, VisitorState state) Deprecated.preferASTHelpers.hasAnnotation(Symbol, String, VisitorState)
to avoid needing a runtime dependency on the annotation class, and to prevent issues if there is skew between the definition of the annotation on the runtime and compile-time classpathsstatic boolean
ASTHelpers.hasAnnotation
(com.sun.tools.javac.code.Symbol sym, String annotationClass, VisitorState state) Determines whether a symbol has an annotation of the given type.static boolean
ASTHelpers.hasExplicitSource
(com.sun.source.tree.Tree tree, VisitorState state) Returns whether the given tree has an explicit source code representation.static boolean
ASTHelpers.hasImplicitType
(com.sun.source.tree.VariableTree tree, VisitorState state) Returns whether this is avar
or a lambda parameter that has no explicit type.static boolean
ASTHelpers.hasNoExplicitType
(com.sun.source.tree.VariableTree tree, VisitorState state) Deprecated.static boolean
ASTHelpers.hasOverloadWithOnlyOneParameter
(com.sun.tools.javac.code.Symbol.MethodSymbol existingMethod, com.sun.tools.javac.util.Name targetMethodName, com.sun.tools.javac.code.Type onlyParameterType, VisitorState state) Returns whetherexistingMethod
has an overload (or "nearly" an overload) with the giventargetMethodName
, and only a single parameter of typeonlyParameterType
.static boolean
ASTHelpers.inSamePackage
(com.sun.tools.javac.code.Symbol targetSymbol, VisitorState state) Return true if the given symbol is defined in the current package.static boolean
ASTHelpers.isBugCheckerCode
(VisitorState state) Returnstrue
if the code is in a BugChecker class.static boolean
ASTHelpers.isCastable
(com.sun.tools.javac.code.Type s, com.sun.tools.javac.code.Type t, VisitorState state) Returns true iferasure(s)
is castable toerasure(t)
.static boolean
ASTHelpers.isCheckedExceptionType
(com.sun.tools.javac.code.Type t, VisitorState state) Returns true ift
is a subtype of Throwable but not a subtype of RuntimeException or Error.static boolean
ASTHelpers.isInStaticInitializer
(VisitorState state) Attempts to detect whether we're in a static-initializer-like context: that includes direct assignments to static fields, assignments to enum fields, being contained within an expression which is ultimately assigned to a static field.static boolean
ASTHelpers.isJUnitTestCode
(VisitorState state) Returns true if the leaf node in theTreePath
fromstate
sits somewhere underneath a class or method that is marked as JUnit 3 or 4 test code.static boolean
ASTHelpers.isKotlin
(com.sun.tools.javac.code.Symbol symbol, VisitorState state) Returnstrue
if this symbol was declared in Kotlin source.static boolean
ASTHelpers.isSameType
(com.sun.tools.javac.code.Type s, com.sun.tools.javac.code.Type t, VisitorState state) Returns true iferasure(s) == erasure(t)
.static boolean
ASTHelpers.isSubtype
(com.sun.tools.javac.code.Type s, com.sun.tools.javac.code.Type t, VisitorState state) Returns true iferasure(s) <: erasure(t)
.static boolean
ASTHelpers.isTestNgTestCode
(VisitorState state) Returns true if the leaf node in theTreePath
fromstate
sits somewhere underneath a class or method that is marked as TestNG test code.static boolean
ASTHelpers.isVoidType
(com.sun.tools.javac.code.Type type, VisitorState state) Return true if the given type is 'void' or 'Void'.static @Nullable 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.static boolean
ASTHelpers.methodIsPublicAndNotAnOverride
(com.sun.tools.javac.code.Symbol.MethodSymbol method, VisitorState state) Returns true if the given method symbol is public (both the method and the enclosing class) and does not have a super-method (i.e., it is not an@Override
).static boolean
ASTHelpers.requiresParentheses
(com.sun.source.tree.ExpressionTree expression, VisitorState state) Checks whether an expression requires parentheses.static @Nullable com.sun.tools.javac.code.Symbol.MethodSymbol
ASTHelpers.resolveExistingMethod
(VisitorState state, com.sun.tools.javac.code.Symbol.TypeSymbol base, com.sun.tools.javac.util.Name name, Iterable<com.sun.tools.javac.code.Type> argTypes, Iterable<com.sun.tools.javac.code.Type> tyargTypes) Given a Type (base
), find the method namedname
, with the appropriateargTypes
andtyargTypes
and return its MethodSymbol.abstract boolean
Visibility.shouldBeVisible
(com.sun.source.tree.Tree tree, VisitorState state) Whethertree
should be visible from the path instate
assuming we're in prod code.abstract boolean
Visibility.shouldBeVisible
(com.sun.tools.javac.code.Symbol symbol, VisitorState state) Whethersymbol
should be visible from the path instate
assuming we're in prod code.static @Nullable ASTHelpers.TargetType
ASTHelpers.targetType
(VisitorState state) Returns the target type of the tree at the givenVisitorState
's path, or elsenull
.
ASTHelpers.hasAnnotation(Symbol, String, VisitorState)
to avoid needing a runtime dependency on the annotation class, and to prevent issues if there is skew between the definition of the annotation on the runtime and compile-time classpaths