Class NewScanner
java.lang.Object
com.sun.source.util.TreeScanner<Void,Void>
com.sun.source.util.TreePathScanner<Void,Void>
org.checkerframework.afu.annotator.scanner.CommonScanner
org.checkerframework.afu.annotator.scanner.NewScanner
- All Implemented Interfaces:
TreeVisitor<Void,Void>
NewScanner scans the source tree and determines the index of a given new, where the i^th index
corresponds to the i^th new, using 0-based indexing.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddNewToMethod(String methodName, Integer offset) static voidstatic IntegergetMethodNewIndex(String methodName, Integer offset) static intindexOfNewTree(TreePath origpath, Tree tree) Computes the index of the given new tree amongst all new trees inside its method, using 0-based indexing.visitNewArray(NewArrayTree node, Void p) visitNewClass(NewClassTree node, Void p) Methods inherited from class org.checkerframework.afu.annotator.scanner.CommonScanner
visitClassMethods inherited from class com.sun.source.util.TreePathScanner
getCurrentPath, scan, scanMethods inherited from class com.sun.source.util.TreeScanner
reduce, scan, visitAnnotatedType, visitAnnotation, visitAnyPattern, visitArrayAccess, visitArrayType, visitAssert, visitAssignment, visitBinary, visitBindingPattern, visitBlock, visitBreak, visitCase, visitCatch, 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, visitOpens, visitOther, visitPackage, visitParameterizedType, visitParenthesized, visitPatternCaseLabel, visitPrimitiveType, visitProvides, visitRequires, visitReturn, visitStringTemplate, visitSwitch, visitSwitchExpression, visitSynchronized, visitThrow, visitTry, visitTypeCast, visitTypeParameter, visitUnary, visitUnionType, visitUses, visitVariable, visitWhileLoop, visitWildcard, visitYield
-
Method Details
-
indexOfNewTree
Computes the index of the given new tree amongst all new trees inside its method, using 0-based indexing. The tree has to be either a NewClassTree or a NewArrayTree. If the tree is not in a method, then the index is computed- Parameters:
origpath- the path ending in the given cast treetree- the cast tree to search for- Returns:
- the index of the given cast tree
-
visitNewClass
- Specified by:
visitNewClassin interfaceTreeVisitor<Void,Void> - Overrides:
visitNewClassin classTreeScanner<Void,Void>
-
visitNewArray
- Specified by:
visitNewArrayin interfaceTreeVisitor<Void,Void> - Overrides:
visitNewArrayin classTreeScanner<Void,Void>
-
debug
-
addNewToMethod
-
getMethodNewIndex
-