Ejemplo n.º 1
0
 /*
  * @see ASTVisitor#visit(ClassInstanceCreation)
  */
 public boolean visit(ClassInstanceCreation node) {
   if (node.getExpression() != null) {
     node.getExpression().accept(this);
     this.fBuffer.append("."); // $NON-NLS-1$
   }
   this.fBuffer.append("new "); // $NON-NLS-1$
   //		if (node.getAST().apiLevel() == AST.JLS2) {
   //			node.getName().accept(this);
   //		}
   //		if (node.getAST().apiLevel() >= AST.JLS3) {
   //			if (!node.typeArguments().isEmpty()) {
   //				this.fBuffer.append("<");//$NON-NLS-1$
   //				for (Iterator it= node.typeArguments().iterator(); it.hasNext();) {
   //					Type t= (Type) it.next();
   //					t.accept(this);
   //					if (it.hasNext()) {
   //						this.fBuffer.append(",");//$NON-NLS-1$
   //					}
   //				}
   //				this.fBuffer.append(">");//$NON-NLS-1$
   //			}
   //			node.getType().accept(this);
   //		}
   node.getMember().accept(this);
   this.fBuffer.append("("); // $NON-NLS-1$
   for (Iterator it = node.arguments().iterator(); it.hasNext(); ) {
     Expression e = (Expression) it.next();
     e.accept(this);
     if (it.hasNext()) {
       this.fBuffer.append(","); // $NON-NLS-1$
     }
   }
   this.fBuffer.append(")"); // $NON-NLS-1$
   if (node.getAnonymousClassDeclaration() != null) {
     node.getAnonymousClassDeclaration().accept(this);
   }
   return false;
 }
 public boolean visit(ClassInstanceCreation node) {
   if (matches(node.resolveConstructorBinding())) {
     fResult.add(node.getType());
   }
   return super.visit(node);
 }