Class Scanner
java.lang.Object
com.sun.source.util.TreeScanner<Void,VisitorState>
com.sun.source.util.TreePathScanner<Void,VisitorState>
com.google.errorprone.scanner.Scanner
- All Implemented Interfaces:
com.sun.source.tree.TreeVisitor<Void,
VisitorState>
- Direct Known Subclasses:
ErrorProneScanner
@CheckReturnValue
public class Scanner
extends com.sun.source.util.TreePathScanner<Void,VisitorState>
TODO(eaftan): I'm worried about this performance of this code, specifically the part that handles
SuppressWarnings. We should profile it and see where the hotspots are.
- Author:
- alexeagle@google.com (Alex Eagle), eaftan@google.com (Eddie Aftandilian)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Set
<? extends com.sun.tools.javac.util.Name> Returns a set of all the custom suppression annotation types used by theBugChecker
s in thisScanner
.protected void
handleError
(Suppressible s, Throwable t) Handles an exception thrown by an individual check.protected SuppressionInfo.SuppressedState
isSuppressed
(Suppressible suppressible, ErrorProneOptions errorProneOptions, VisitorState state) Returns if this checker should be suppressed on the current tree path.protected void
reportMatch
(Description description, VisitorState state) scan
(com.sun.source.tree.Tree tree, VisitorState state) Scan a single node.scan
(com.sun.source.util.TreePath path, VisitorState state) Scan a tree from a position identified by a TreePath.Returns a mapping between the canonical names of checks and theirBugPattern.SeverityLevel
.Methods inherited from class com.sun.source.util.TreePathScanner
getCurrentPath
Methods inherited from class com.sun.source.util.TreeScanner
reduce, scan, visitAnnotatedType, visitAnnotation, visitAnyPattern, visitArrayAccess, visitArrayType, visitAssert, visitAssignment, visitBinary, visitBindingPattern, visitBlock, visitBreak, visitCase, visitCatch, visitClass, visitCompilationUnit, visitCompoundAssignment, visitConditionalExpression, visitConstantCaseLabel, visitContinue, visitDeconstructionPattern, visitDefaultCaseLabel, visitDoWhileLoop, visitEmptyStatement, visitEnhancedForLoop, visitErroneous, visitExports, visitExpressionStatement, visitForLoop, visitIdentifier, visitIf, visitImport, visitInstanceOf, visitIntersectionType, visitLabeledStatement, visitLambdaExpression, visitLiteral, visitMemberReference, visitMemberSelect, visitMethod, visitMethodInvocation, visitModifiers, visitModule, visitNewArray, visitNewClass, visitOpens, visitOther, visitPackage, visitParameterizedType, visitParenthesized, visitPatternCaseLabel, visitPrimitiveType, visitProvides, visitRequires, visitReturn, visitSwitch, visitSwitchExpression, visitSynchronized, visitThrow, visitTry, visitTypeCast, visitTypeParameter, visitUnary, visitUnionType, visitUses, visitVariable, visitWhileLoop, visitWildcard, visitYield
-
Constructor Details
-
Scanner
public Scanner()
-
-
Method Details
-
scan
Scan a tree from a position identified by a TreePath.- Overrides:
scan
in classcom.sun.source.util.TreePathScanner<Void,
VisitorState>
-
scan
Scan a single node. The current path is updated for the duration of the scan.- Overrides:
scan
in classcom.sun.source.util.TreePathScanner<Void,
VisitorState>
-
isSuppressed
protected SuppressionInfo.SuppressedState isSuppressed(Suppressible suppressible, ErrorProneOptions errorProneOptions, VisitorState state) Returns if this checker should be suppressed on the current tree path.- Parameters:
suppressible
- holds information about the suppressibility of a checkererrorProneOptions
- Options object configuring whether or not to suppress non-errors in
-
getCustomSuppressionAnnotations
protected Set<? extends com.sun.tools.javac.util.Name> getCustomSuppressionAnnotations(VisitorState state) Returns a set of all the custom suppression annotation types used by theBugChecker
s in thisScanner
. -
reportMatch
-
handleError
Handles an exception thrown by an individual check. -
severityMap
Returns a mapping between the canonical names of checks and theirBugPattern.SeverityLevel
.
-