Interface ResultUsePolicyAnalyzer<E,C>

Type Parameters:
E - the type of an expression node in the AST
C - the type of the context object used during AST analysis
All Known Implementing Classes:
AbstractReturnValueIgnored, CheckReturnValue, FutureReturnValueIgnored, IgnoredPureGetter, ProtoBuilderReturnValueIgnored, RectIntersectReturnValueIgnored, ReturnValueIgnored, RxReturnValueIgnored

public interface ResultUsePolicyAnalyzer<E,C>
An object that can report on the behavior of a CRV-related check for analysis purposes.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns all of the name strings that this checker should respect as part of a @SuppressWarnings annotation.
    The canonical name of the check.
    default com.google.common.collect.ImmutableMap<String,? extends Object>
    getMatchMetadata(E expression, C context)
    Returns a map of optional metadata about why this check matched the given expression.
    getMethodPolicy(E expression, C context)
    Returns the ResultUsePolicy for the method used in the given expression.
    boolean
    isCovered(E expression, C context)
    Returns whether this checker makes any determination about whether the given expression's return value should be used or not.
  • Method Details

    • canonicalName

      String canonicalName()
      The canonical name of the check.
    • allNames

      Set<String> allNames()
      Returns all of the name strings that this checker should respect as part of a @SuppressWarnings annotation.
    • isCovered

      boolean isCovered(E expression, C context)
      Returns whether this checker makes any determination about whether the given expression's return value should be used or not. Most checkers either determine that an expression is CRV or make no determination.
    • getMethodPolicy

      ResultUsePolicy getMethodPolicy(E expression, C context)
      Returns the ResultUsePolicy for the method used in the given expression.
    • getMatchMetadata

      default com.google.common.collect.ImmutableMap<String,? extends Object> getMatchMetadata(E expression, C context)
      Returns a map of optional metadata about why this check matched the given expression.