예제 #1
0
 @Override
 public boolean visit(SuperConstructorInvocation node) {
   IMethodBinding binding = node.resolveConstructorBinding();
   List args = node.arguments();
   handleMethodCall(node, binding, args);
   return super.visit(node);
 }
  /*
   * @see ASTVisitor#visit(SuperConstructorInvocation)
   */
  @Override
  public boolean visit(SuperConstructorInvocation node) {
    if (!isAffected(node)) {
      return false;
    }

    evalQualifyingExpression(node.getExpression(), null);
    doVisitChildren(node.typeArguments());
    doVisitChildren(node.arguments());
    return false;
  }
 /*
  * @see edu.berkeley.eduride.isa.corext.dom.GenericVisitor#visit(org.eclipse.jdt.core.dom.ConstructorInvocation)
  * @since 3.5
  */
 public boolean visit(SuperConstructorInvocation node) {
   // XXX Hack for performance reasons (should loop over fJobSemanticHighlightings can call
   // consumes(*))
   if (fJobDeprecatedMemberHighlighting != null) {
     IMethodBinding constructorBinding = node.resolveConstructorBinding();
     if (constructorBinding != null && constructorBinding.isDeprecated()) {
       int offset = node.getStartPosition();
       int length = 5;
       if (offset > -1 && length > 0)
         addPosition(offset, length, fJobDeprecatedMemberHighlighting);
     }
   }
   return true;
 }
  /**
   * Find invocations of the supertype's constructor from the called method (=constructor). Since we
   * only traverse into the AST on the wanted method declaration, this method should not hit on more
   * method invocations than those in the wanted method.
   *
   * @see
   *     org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SuperConstructorInvocation)
   */
  public boolean visit(SuperConstructorInvocation node) {
    progressMonitorWorked(1);
    if (!isFurtherTraversalNecessary(node)) {
      return false;
    }

    if (isNodeWithinMethod(node)) {
      addMethodCall(node.resolveConstructorBinding(), node);
    }

    return true;
  }
 /*
  * @see ASTVisitor#visit(SuperConstructorInvocation)
  */
 public boolean visit(SuperConstructorInvocation node) {
   if (node.getExpression() != null) {
     node.getExpression().accept(this);
     this.fBuffer.append("."); // $NON-NLS-1$
   }
   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$
     }
   }
   this.fBuffer.append("super("); // $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$
   return false;
 }