Class IgnoredPureGetter

All Implemented Interfaces:
BugChecker.MemberReferenceTreeMatcher, BugChecker.MethodInvocationTreeMatcher, BugChecker.NewClassTreeMatcher, BugChecker.ReturnTreeMatcher, ResultUsePolicyAnalyzer<com.sun.source.tree.ExpressionTree,VisitorState>, Suppressible, Serializable

public final class IgnoredPureGetter extends AbstractReturnValueIgnored
Flags ignored return values from pure getters.
See Also:
  • Method Details

    • specializedMatcher

      protected Matcher<? super com.sun.source.tree.ExpressionTree> 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 class AbstractReturnValueIgnored
    • 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 class AbstractReturnValueIgnored