Class PackagesRule

java.lang.Object
com.google.errorprone.bugpatterns.checkreturnvalue.ResultUseRule<VisitorState,com.sun.tools.javac.code.Symbol>
com.google.errorprone.bugpatterns.checkreturnvalue.ResultUseRule.SymbolRule<VisitorState,com.sun.tools.javac.code.Symbol>
com.google.errorprone.bugpatterns.checkreturnvalue.PackagesRule

public final class PackagesRule extends ResultUseRule.SymbolRule<VisitorState,com.sun.tools.javac.code.Symbol>
A rule that enables checking for methods belonging to a set of packages or any of their subpackages.
  • Method Details

    • fromPatterns

      public static PackagesRule fromPatterns(Iterable<String> patterns)
      Returns a new rule using the given package patterns. Each pattern string must either be the fully qualified name of a package (to enable checking for methods in that package and its subpackages) or a - character followed by the fully qualified name of a package (to disable checking for methods in that package and its subpackages).
    • id

      public final String id()
      Description copied from class: ResultUseRule
      An ID for uniquely identifying this rule.
      Specified by:
      id in class ResultUseRule<VisitorState,com.sun.tools.javac.code.Symbol>
    • evaluate

      public Optional<ResultUsePolicy> evaluate(com.sun.tools.javac.code.Symbol symbol, VisitorState state)
      Description copied from class: ResultUseRule
      Evaluates the given symbol and optionally returns a ResultUsePolicy for it.
      Specified by:
      evaluate in class ResultUseRule<VisitorState,com.sun.tools.javac.code.Symbol>