public class ConstructorTranslator extends com.sun.tools.javac.tree.TreeTranslator implements Translator<Method>
ConstructorTranslator is used to traverse the instrumented constructor method and assure that the first statement
is a call to the original super()/this() calls in the method. The implementation takes into account that other
instrumentation steps might move the super()/this() calls into nested blocks, so it searches for
the original calls, remove those and moves them to be the first statement in the method body.| Constructor and Description |
|---|
ConstructorTranslator(JavaCompilerHelper helper) |
| Modifier and Type | Method and Description |
|---|---|
void |
translate(Method model) |
void |
visitBlock(com.sun.tools.javac.tree.JCTree.JCBlock block) |
void |
visitMethodDef(com.sun.tools.javac.tree.JCTree.JCMethodDecl jcMethodDecl) |
translate, translate, translateAnnotations, translateCases, translateCatchers, translateTypeParams, translateVarDefs, visitAnnotation, visitApply, visitAssert, visitAssign, visitAssignop, visitBinary, visitBreak, visitCase, visitCatch, visitClassDef, visitConditional, visitContinue, visitDoLoop, visitErroneous, visitExec, visitForeachLoop, visitForLoop, visitIdent, visitIf, visitImport, visitIndexed, visitLabelled, visitLetExpr, visitLiteral, visitModifiers, visitNewArray, visitNewClass, visitParens, visitReturn, visitSelect, visitSkip, visitSwitch, visitSynchronized, visitThrow, visitTopLevel, visitTree, visitTry, visitTypeApply, visitTypeArray, visitTypeBoundKind, visitTypeCast, visitTypeIdent, visitTypeParameter, visitTypeTest, visitTypeUnion, visitUnary, visitVarDef, visitWhileLoop, visitWildcardpublic ConstructorTranslator(JavaCompilerHelper helper)
public void translate(Method model)
translate in interface Translator<Method>public void visitMethodDef(com.sun.tools.javac.tree.JCTree.JCMethodDecl jcMethodDecl)
visitMethodDef in class com.sun.tools.javac.tree.TreeTranslatorpublic void visitBlock(com.sun.tools.javac.tree.JCTree.JCBlock block)
visitBlock in class com.sun.tools.javac.tree.TreeTranslator