Class Scanner
- All Implemented Interfaces:
TreeVisitor<Void, VisitorState>
- Direct Known Subclasses:
ErrorProneScanner
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
Constructors -
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 theBugCheckers in thisScanner.protected voidhandleError(Suppressible s, Throwable t) Handles an exception thrown by an individual check.protected SuppressionInfo.SuppressedStateisSuppressed(Suppressible suppressible, ErrorProneOptions errorProneOptions, VisitorState state) Returns if this checker should be suppressed on the current tree path.protected voidreportMatch(Description description, VisitorState state) scan(Tree tree, VisitorState state) Scan a single node.scan(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 TreePathScanner
getCurrentPathMethods inherited from class 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:
scanin classTreePathScanner<Void, VisitorState>
-
scan
Scan a single node. The current path is updated for the duration of the scan.- Overrides:
scanin classTreePathScanner<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 theBugCheckers 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.
-