Class MethodCallScanner
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.MethodCallScanner
- All Implemented Interfaces:
TreeVisitor<Void,
Void>
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addMethodCallToMethod
(String methodName, Integer offset) Adds a lambda expression bytecode offset to the current list of offsets for methodName.static Integer
getMethodCallIndex
(String methodName, Integer offset) Returns the index of the given offset within the list of offsets for the given method, using 0-based indexing, or returns a negative number if the offset is not one of the offsets in the context.static int
indexOfMethodCallTree
(TreePath origpath, Tree tree) Computes the index of the given method invocation amongst all method invocation trees inside its method, using 0-based indexing.Methods inherited from class org.checkerframework.afu.annotator.scanner.CommonScanner
visitClass
Methods inherited from class com.sun.source.util.TreePathScanner
getCurrentPath, scan, scan
Methods 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, visitModifiers, visitModule, visitNewArray, visitNewClass, 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
-
indexOfMethodCallTree
Computes the index of the given method invocation amongst all method invocation trees inside its method, using 0-based indexing.- Parameters:
origpath
- the path ending in the given method invocation treetree
- the method invocation tree to search for- Returns:
- the index of the given method invocation tree
-
visitMethodInvocation
- Specified by:
visitMethodInvocation
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitMethodInvocation
in classTreeScanner<Void,
Void>
-
addMethodCallToMethod
Adds a lambda expression bytecode offset to the current list of offsets for methodName. This method must be called with monotonically increasing offsets for any one method.- Parameters:
methodName
- the name of the methodoffset
- the offset to add
-
getMethodCallIndex
Returns the index of the given offset within the list of offsets for the given method, using 0-based indexing, or returns a negative number if the offset is not one of the offsets in the context.- Parameters:
methodName
- the name of the methodoffset
- the offset of the lambda expression- Returns:
- the index of the given offset, or a negative number if the offset does not exist inside the context
-