@Immutable @CheckReturnValue public class SuppressionInfo extends Object
Suppressibleobject should be considered suppressed.
SuppressionInfo instances are obtained by starting with the
EMPTY instance, then
getting new instances by calling
withExtendedSuppressions(com.sun.tools.javac.code.Symbol, com.google.errorprone.VisitorState, java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>>) with symbols discovered as you
descend a program tree.
|Modifier and Type||Class and Description|
|Modifier and Type||Method and Description|
Returns true if
Returns true if this checker should be considered suppressed given the signals present in this object.
Returns an instance of
public static final SuppressionInfo EMPTY
public SuppressionInfo.SuppressedState suppressedState(Suppressible suppressible, boolean suppressedInGeneratedCode)
suppressible- Holds information about the suppressibilty of a checker
suppressedInGeneratedCode- true if this checker instance should be considered suppressed if the signals in this object say we're in generated code.
public boolean isNameSuppressed(String name)
nameis a suppressed name according to the suppression signals in this object (namely, is a member of previously-seen
public SuppressionInfo forCompilationUnit(com.sun.source.tree.CompilationUnitTree tree, VisitorState state)
CompilationUnitTree. This differs in that
isGeneratedis determined by inspecting the annotations of the outermost class so that matchers on
CompilationUnitTreewill also be suppressed.
public SuppressionInfo withExtendedSuppressions(com.sun.tools.javac.code.Symbol sym, VisitorState state, Set<Class<? extends Annotation>> customSuppressionAnnosToLookFor)
SuppressionInfothat takes into account any suppression signals present on
symas well as those already stored in
Checks suppressions for any
custom suppression annotations described by
We do not modify the existing suppression sets, so they can be restored when moving up the tree. We also avoid copying the suppression sets if the next node to explore does not have any suppressed warnings or custom suppression annotations. This is the common case.
Symbolfor the AST node currently being scanned
state- VisitorState for checking the current tree, as well as for getting the
SuppressWarnings symbol type.
Copyright © 2019. All rights reserved.