context.setArgumentIndex(argumentIndex); JCTree.JCExpression identifier = newClass.getIdentifier(); String name = identifier.toString();
@Override public void visitNewClass(JCNewClass node) { ConstructorInvocation inv = new ConstructorInvocation(); fillList(node.getArguments(), inv.rawArguments()); fillList(node.getTypeArguments(), inv.rawConstructorTypeArguments(), FlagKey.TYPE_REFERENCE); inv.rawTypeReference(toTree(node.getIdentifier(), FlagKey.TYPE_REFERENCE)); inv.rawQualifier(toTree(node.getEnclosingExpression())); Node n = toTree(node.getClassBody()); if (n instanceof TypeDeclaration) { NormalTypeBody body = ((ClassDeclaration) n).astBody(); if (body != null) body.unparent(); inv.rawAnonymousClassBody(setPos(node.getClassBody(), body)); } set(node, inv); }
@Override public void visitNewClass(JCNewClass node) { ConstructorInvocation inv = new ConstructorInvocation(); fillList(node.getArguments(), inv.rawArguments()); fillList(node.getTypeArguments(), inv.rawConstructorTypeArguments(), FlagKey.TYPE_REFERENCE); inv.rawTypeReference(toTree(node.getIdentifier(), FlagKey.TYPE_REFERENCE)); inv.rawQualifier(toTree(node.getEnclosingExpression())); Node n = toTree(node.getClassBody()); if (n instanceof TypeDeclaration) { NormalTypeBody body = ((ClassDeclaration) n).astBody(); if (body != null) body.unparent(); inv.rawAnonymousClassBody(setPos(node.getClassBody(), body)); } set(node, inv); }
@Override public void visitNewClass(JCNewClass node) { ConstructorInvocation inv = new ConstructorInvocation(); fillList(node.getArguments(), inv.rawArguments()); fillList(node.getTypeArguments(), inv.rawConstructorTypeArguments(), FlagKey.TYPE_REFERENCE); inv.rawTypeReference(toTree(node.getIdentifier(), FlagKey.TYPE_REFERENCE)); inv.rawQualifier(toTree(node.getEnclosingExpression())); Node n = toTree(node.getClassBody()); if (n instanceof TypeDeclaration) { NormalTypeBody body = ((ClassDeclaration) n).astBody(); if (body != null) body.unparent(); inv.rawAnonymousClassBody(setPos(node.getClassBody(), body)); } set(node, inv); }
private boolean matchNewClass(JCNewClass t1, JCNewClass t2) { return t1.constructor == t2.constructor && treesMatch(t1.getIdentifier(), t2.getIdentifier()) && listsMatch(t1.typeargs, t2.typeargs) && listsMatch(t1.args, t2.args) && (t1.varargsElement == t2.varargsElement) && treesMatch(t1.def, t2.def); }