Class IgnoredPureGetter
java.lang.Object
com.google.errorprone.bugpatterns.BugChecker
com.google.errorprone.bugpatterns.AbstractReturnValueIgnored
com.google.errorprone.bugpatterns.IgnoredPureGetter
- All Implemented Interfaces:
BugChecker.MemberReferenceTreeMatcher
,BugChecker.MethodInvocationTreeMatcher
,BugChecker.NewClassTreeMatcher
,BugChecker.ReturnTreeMatcher
,ResultUsePolicyAnalyzer<com.sun.source.tree.ExpressionTree,
,VisitorState> Suppressible
,Serializable
Flags ignored return values from pure getters.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.errorprone.bugpatterns.BugChecker
BugChecker.AnnotatedTypeTreeMatcher, BugChecker.AnnotationTreeMatcher, BugChecker.ArrayAccessTreeMatcher, BugChecker.ArrayTypeTreeMatcher, BugChecker.AssertTreeMatcher, BugChecker.AssignmentTreeMatcher, BugChecker.BinaryTreeMatcher, BugChecker.BlockTreeMatcher, BugChecker.BreakTreeMatcher, BugChecker.CaseTreeMatcher, BugChecker.CatchTreeMatcher, BugChecker.ClassTreeMatcher, BugChecker.CompilationUnitTreeMatcher, BugChecker.CompoundAssignmentTreeMatcher, BugChecker.ConditionalExpressionTreeMatcher, BugChecker.ContinueTreeMatcher, BugChecker.DoWhileLoopTreeMatcher, BugChecker.EmptyStatementTreeMatcher, BugChecker.EnhancedForLoopTreeMatcher, BugChecker.ExpressionStatementTreeMatcher, BugChecker.ForLoopTreeMatcher, BugChecker.IdentifierTreeMatcher, BugChecker.IfTreeMatcher, BugChecker.ImportTreeMatcher, BugChecker.InstanceOfTreeMatcher, BugChecker.IntersectionTypeTreeMatcher, BugChecker.LabeledStatementTreeMatcher, BugChecker.LambdaExpressionTreeMatcher, BugChecker.LiteralTreeMatcher, BugChecker.MemberReferenceTreeMatcher, BugChecker.MemberSelectTreeMatcher, BugChecker.MethodInvocationTreeMatcher, BugChecker.MethodTreeMatcher, BugChecker.ModifiersTreeMatcher, BugChecker.NewArrayTreeMatcher, BugChecker.NewClassTreeMatcher, BugChecker.ParameterizedTypeTreeMatcher, BugChecker.ParenthesizedTreeMatcher, BugChecker.PrimitiveTypeTreeMatcher, BugChecker.ReturnTreeMatcher, BugChecker.SuppressibleTreePathScanner<R,
P>, BugChecker.SwitchTreeMatcher, BugChecker.SynchronizedTreeMatcher, BugChecker.ThrowTreeMatcher, BugChecker.TryTreeMatcher, BugChecker.TypeCastTreeMatcher, BugChecker.TypeParameterTreeMatcher, BugChecker.UnaryTreeMatcher, BugChecker.UnionTypeTreeMatcher, BugChecker.VariableTreeMatcher, BugChecker.WhileLoopTreeMatcher, BugChecker.WildcardTreeMatcher -
Method Summary
Modifier and TypeMethodDescriptionprotected Description
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.com.google.common.collect.ImmutableMap
<String, ?> getMatchMetadata
(com.sun.source.tree.ExpressionTree tree, VisitorState state) Returns a map of optional metadata about why this check matched the given expression.protected Matcher
<? super com.sun.source.tree.ExpressionTree> Match whatever additional conditions concrete subclasses want to match (a list of known side-effect-free methods, has a @CheckReturnValue annotation, etc.).Methods inherited from class com.google.errorprone.bugpatterns.AbstractReturnValueIgnored
allowInExceptionThrowers, describeReturnValueIgnored, describeReturnValueIgnored, getMessage, getMethodPolicy, isCovered, lostType, lostTypeMessage, matchMemberReference, matchMethodInvocation, matchNewClass, matchReturn
Methods inherited from class com.google.errorprone.bugpatterns.BugChecker
allNames, buildDescription, buildDescription, buildDescription, canonicalName, customSuppressionAnnotations, defaultSeverity, describeMatch, describeMatch, describeMatch, describeMatch, describeMatch, describeMatch, disableable, equals, hashCode, isSuppressed, isSuppressed, isSuppressed, isSuppressed, linkUrl, message, supportsSuppressWarnings, suppressedByAnyOf, suppressedRegions
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.google.errorprone.bugpatterns.checkreturnvalue.ResultUsePolicyAnalyzer
allNames, canonicalName
Methods inherited from interface com.google.errorprone.matchers.Suppressible
allNames, canonicalName, customSuppressionAnnotations, supportsSuppressWarnings, suppressedByAnyOf
-
Method Details
-
specializedMatcher
Description copied from class:AbstractReturnValueIgnored
Match whatever additional conditions concrete subclasses want to match (a list of known side-effect-free methods, has a @CheckReturnValue annotation, etc.).- Specified by:
specializedMatcher
in classAbstractReturnValueIgnored
-
getMatchMetadata
public com.google.common.collect.ImmutableMap<String,?> getMatchMetadata(com.sun.source.tree.ExpressionTree tree, VisitorState state) Description copied from interface:ResultUsePolicyAnalyzer
Returns a map of optional metadata about why this check matched the given expression. -
describeReturnValueIgnored
protected Description describeReturnValueIgnored(com.sun.source.tree.MethodInvocationTree methodInvocationTree, VisitorState state) Description copied from class:AbstractReturnValueIgnored
Fixes the error by assigning the result of the call to the receiver reference, or deleting the method call. Subclasses may override if they prefer a different description.- Overrides:
describeReturnValueIgnored
in classAbstractReturnValueIgnored
-