Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.SuperMethodInvocation


        TypeDeclaration type = getTypeDeclaration(workingUnit, bug.getPrimaryClass());
        MethodDeclaration method = getMethodDeclaration(type, bug.getPrimaryMethod());

        AST ast = rewrite.getAST();

        SuperMethodInvocation superCall = createSuperMethodInvocation(rewrite, method);
        ExpressionStatement statement = ast.newExpressionStatement(superCall);
        Block methodBody = method.getBody();
        ListRewrite listRewrite = rewrite.getListRewrite(methodBody, Block.STATEMENTS_PROPERTY);
        if (isInsertFirst()) {
            listRewrite.insertFirst(statement, null);
View Full Code Here


    protected SuperMethodInvocation createSuperMethodInvocation(ASTRewrite rewrite, MethodDeclaration method) {
        assert rewrite != null;
        assert method != null;

        AST ast = rewrite.getAST();
        SuperMethodInvocation invocation = ast.newSuperMethodInvocation();

        invocation.setName((SimpleName) rewrite.createCopyTarget(method.getName()));

        return invocation;
    }
View Full Code Here

            topTimestamp.setName(ast.newSimpleName("getTopTimestamp"));
            commitFields.arguments().add(topTimestamp);
            body.statements().add(ast.newExpressionStatement(commitFields));

            // Add a call to the commit method in the superclass, if necessary.
            SuperMethodInvocation superRestore = ast.newSuperMethodInvocation();
            superRestore
                    .setName(ast.newSimpleName(_getCommitMethodName(false)));
            superRestore.arguments().add(ast.newSimpleName("timestamp"));

            if ((parent != null)
                    && (state.getCrossAnalyzedTypes()
                            .contains(parent.getName()) || hasMethod(parent,
                            methodName,
View Full Code Here

                            ast.newExpressionStatement(assignment));
                }
            }

            // Add a call to the restore method in the superclass, if necessary.
            SuperMethodInvocation superRestore = ast.newSuperMethodInvocation();
            superRestore.setName(ast
                    .newSimpleName(_getRestoreMethodName(false)));
            superRestore.arguments().add(ast.newSimpleName("timestamp"));
            superRestore.arguments().add(ast.newSimpleName("trim"));

            Statement superRestoreStatement = ast
                    .newExpressionStatement(superRestore);

            if ((parent != null)
View Full Code Here

          this.findFormalsForVariable(ctorCall);
      break;
    }

    case ASTNode.SUPER_METHOD_INVOCATION: {
      final SuperMethodInvocation smi = (SuperMethodInvocation) node;
      // if coming up from a argument.
      if (containedIn(smi.arguments(), this.name))
        // if we don't have the source, no can do.
        if (!smi.resolveMethodBinding().getDeclaringClass()
            .isFromSource())
          throw new DefinitelyNotEnumerizableException(
              Messages.ASTNodeProcessor_SourceNotPresent, node);
        else
          // go find the formals.
View Full Code Here

      this.found.add(elem);
      break;
    }

    case ASTNode.SUPER_METHOD_INVOCATION: {
      final SuperMethodInvocation sm = (SuperMethodInvocation) node;
      final IMethod meth = (IMethod) sm.resolveMethodBinding()
          .getJavaElement();
      final IMethod top = Util.getTopMostSourceMethod(meth, this.monitor);

      if (top == null)
        throw new DefinitelyNotEnumerizableException(
View Full Code Here

    Expression parameter = createParameter(methodId, classId);

    SimpleName methodName = ast.newSimpleName(methodId.toLowerCase());

    if (qualifier.equals("super__0")) {
      SuperMethodInvocation superMethInv = ast.newSuperMethodInvocation();
      superMethInv.setName(methodName);
      if (parameter != null)
        superMethInv.arguments().add(parameter);
      result = superMethInv;
    } else {
      MethodInvocation methInv = ast.newMethodInvocation();
      methInv.setName(methodName);
      if (parameter != null)
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.dom.SuperMethodInvocation

Copyright © 2018 www.massapicom. 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.