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.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.errorprone.bugpatterns.checkreturnvalue.ResultUseRule
ResultUseRule.Evaluation<S>, ResultUseRule.GlobalRule<C,
S>, ResultUseRule.MethodRule<C, S, M extends S>, ResultUseRule.RuleScope, ResultUseRule.SymbolRule<C, S> -
Method Summary
Modifier and TypeMethodDescriptionevaluate
(com.sun.tools.javac.code.Symbol symbol, VisitorState state) Evaluates the givensymbol
and optionally returns aResultUsePolicy
for it.static PackagesRule
fromPatterns
(Iterable<String> patterns) Returns a new rule using the given packagepatterns
.final String
id()
An ID for uniquely identifying this rule.Methods inherited from class com.google.errorprone.bugpatterns.checkreturnvalue.ResultUseRule.SymbolRule
scopes
Methods inherited from class com.google.errorprone.bugpatterns.checkreturnvalue.ResultUseRule
evaluate, toString
-
Method Details
-
fromPatterns
Returns a new rule using the given packagepatterns
. 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
Description copied from class:ResultUseRule
An ID for uniquely identifying this rule.- Specified by:
id
in classResultUseRule<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 givensymbol
and optionally returns aResultUsePolicy
for it.- Specified by:
evaluate
in classResultUseRule<VisitorState,
com.sun.tools.javac.code.Symbol>
-