Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.MethodInvocation.arguments()


            if (node instanceof PrefixExpression) {
                i += 2;
            }

            invocation.arguments().add(
                    ast.newNumberLiteral(Integer.toString(i)));
        }

        // Add all the indices into the argument list.
        invocation.arguments().addAll(indices);
View Full Code Here


            invocation.arguments().add(
                    ast.newNumberLiteral(Integer.toString(i)));
        }

        // Add all the indices into the argument list.
        invocation.arguments().addAll(indices);

        // Add the right-hand side expression to the argument list.
        Type rightHandType = Type.getType(rightHand);

        if (!isSpecial && type.isPrimitive() && !type.equals(rightHandType)) {
View Full Code Here

                extraPlus.setRightOperand(rightHand);
                rightHand = extraPlus;
            }
        }

        invocation.arguments().add(rightHand);

        // Set the type of this invocation.
        Type.propagateType(invocation, node);

        // Replace the assignment node with this method invocation.
View Full Code Here

            ClassInstanceCreation proxy = ast.newClassInstanceCreation();
            proxy
                    .setType(ast.newSimpleType(ast
                            .newSimpleName(_getProxyName())));
            addInvocation.arguments().add(proxy);
            body.statements().add(ast.newExpressionStatement(addInvocation));
            bodyDeclarations.add(initializer);

            if (declarationRecord != null) {
                declarationRecord._addExtendedDeclaration(initializer);
View Full Code Here

                                int argCount = 0;
                                Expression arg = null;
                                int argumentNumber = desc.getVulnerableParameter();
                                if (expr instanceof MethodInvocation) {
                                    MethodInvocation mi = (MethodInvocation) expr;
                                    argCount = mi.arguments().size();
                                    if (argCount > 0) {
                                        arg = (Expression) mi.arguments().get(argumentNumber);
                                    }
                                   
                                } else if (expr instanceof ClassInstanceCreation) {
View Full Code Here

                                int argumentNumber = desc.getVulnerableParameter();
                                if (expr instanceof MethodInvocation) {
                                    MethodInvocation mi = (MethodInvocation) expr;
                                    argCount = mi.arguments().size();
                                    if (argCount > 0) {
                                        arg = (Expression) mi.arguments().get(argumentNumber);
                                    }
                                   
                                } else if (expr instanceof ClassInstanceCreation) {
                                    ClassInstanceCreation ci = (ClassInstanceCreation) expr;
                                    argCount = ci.arguments().size();
View Full Code Here

                newClassInstanceCreation.setType(newType);
                List arguments = newClassInstanceCreation.arguments();
                arguments.clear();
               
                MethodInvocation initializer = (MethodInvocation) vdf.getInitializer();
                List newArguments = ASTNode.copySubtrees(newClassInstanceCreation.getAST(), initializer.arguments());
                arguments.addAll(newArguments);
                 
                vdf.setInitializer(newClassInstanceCreation);
              }
            }
View Full Code Here

    astRewrite.replace(ie.getRightOperand(), zero, null);

    final MethodInvocation newInvocation = ast.newMethodInvocation();
    newInvocation.setExpression(leftExpCopy);
    newInvocation.setName(ast.newSimpleName("compareTo")); //$NON-NLS-1$
    newInvocation.arguments().add(rightExpCopy);

    astRewrite.replace(ie.getLeftOperand(), newInvocation, null);

    if (((ASTNode) newInvocation.arguments().get(0)).getNodeType() == ASTNode.SIMPLE_NAME
        && this.fieldsToRefactor.contains(((SimpleName) ie
View Full Code Here

    newInvocation.setName(ast.newSimpleName("compareTo")); //$NON-NLS-1$
    newInvocation.arguments().add(rightExpCopy);

    astRewrite.replace(ie.getLeftOperand(), newInvocation, null);

    if (((ASTNode) newInvocation.arguments().get(0)).getNodeType() == ASTNode.SIMPLE_NAME
        && this.fieldsToRefactor.contains(((SimpleName) ie
            .getRightOperand()).resolveBinding().getJavaElement()))
      this.rewriteReference(astRewrite, importRewrite,
          (SimpleName) newInvocation.arguments().get(0),
          fullyQualifiedTypeName);
View Full Code Here

    if (((ASTNode) newInvocation.arguments().get(0)).getNodeType() == ASTNode.SIMPLE_NAME
        && this.fieldsToRefactor.contains(((SimpleName) ie
            .getRightOperand()).resolveBinding().getJavaElement()))
      this.rewriteReference(astRewrite, importRewrite,
          (SimpleName) newInvocation.arguments().get(0),
          fullyQualifiedTypeName);

    if (((ASTNode) newInvocation.getExpression()).getNodeType() == ASTNode.SIMPLE_NAME
        && this.fieldsToRefactor.contains(((SimpleName) ie
            .getLeftOperand()).resolveBinding().getJavaElement()))
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.