Package org.eclipse.jdt.core.dom

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


   
    IValue body = visitChild(node.getBody());
 
    IValueList catchClauses = new IValueList(values);
    for (Iterator it = node.catchClauses().iterator(); it.hasNext();) {
      CatchClause cc = (CatchClause) it.next();
      catchClauses.add(visitChild(cc));
    }
   
    IValue finallyBlock = node.getFinally() == null ? null : visitChild(node.getFinally());
   
View Full Code Here


    controlFlowNode.moveEdges(ControlFlowNode.Direction.BACKWARDS, cfnBody);
   
    List<ControlFlowNode> cfns = new ArrayList<ControlFlowNode>();
    ControlFlowNode cfn = cfnBody, prev = cfnBody;
    Iterator i = catches.iterator();
    CatchClause cc;
    for(;i.hasNext();) {
      cc = (CatchClause) i.next();
      cfn = controlFlowNode.newControlFlowNode(cc);
      prev.addEdge(ControlFlowNode.Direction.FORWARDS, cfn);
      prev = cfn;
View Full Code Here

  public boolean isCaughtVariable() {
    ASTNode parent = this.getNode().getParent();
    if( parent instanceof CatchClause ) {
      // This is not enough. We must make sure that this variable
      // is being declared inside the declaration part.
      CatchClause catch_clause = (CatchClause)parent;
      if( catch_clause.getException().equals(this.getNode()) ) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

  public boolean isCaughtVariable() {
    ASTNode parent = this.getNode().getParent();
    if( parent instanceof CatchClause ) {
      // This is not enough. We must make sure that this variable
      // is being declared inside the declaration part.
      CatchClause catch_clause = (CatchClause)parent;
      if( catch_clause.getException().equals(this.getNode()) ) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

      }
    }
    node.getBody().accept(this);
    this.buffer.append(" ");//$NON-NLS-1$
    for (Iterator it = node.catchClauses().iterator(); it.hasNext(); ) {
      CatchClause cc = (CatchClause) it.next();
      cc.accept(this);
    }
    if (node.getFinally() != null) {
      this.buffer.append(" finally ");//$NON-NLS-1$
      node.getFinally().accept(this);
    }
View Full Code Here

        _output("try ");
        _newLineAfterBlock = false;
        node.getBody().accept(this);

        for (Iterator it = node.catchClauses().iterator(); it.hasNext();) {
            CatchClause cc = (CatchClause) it.next();
            _newLineAfterBlock = !it.hasNext() && (node.getFinally() == null);
            cc.accept(this);
        }

        if (node.getFinally() != null) {
            _output(" finally ");
            node.getFinally().accept(this);
View Full Code Here

      }
    }
    node.getBody().accept(this);
    this.buffer.append(" ");//$NON-NLS-1$
    for (Iterator it = node.catchClauses().iterator(); it.hasNext(); ) {
      CatchClause cc = (CatchClause) it.next();
      cc.accept(this);
    }
    if (node.getFinally() != null) {
      this.buffer.append(" finally ");//$NON-NLS-1$
      node.getFinally().accept(this);
    }
View Full Code Here

      context = new ProcessingContext(context.previousVertice, finallyStart, Pair.create(finallyStart, bc));
    }
    //exceptions next
    if (node.catchClauses() != null && node.catchClauses().size() > 0) {
      for(Object catchClauseObj: node.catchClauses()) {
        CatchClause catchClause = (CatchClause) catchClauseObj;
        CFGVertice catchStart = graph.addNewVertice(catchClause, "Catch " + catchClause.getException());
        graph.createExceptionEdge(context.previousVertice, catchStart, catchClause.getException());
        BlockContext cbc = pushNewBlockContext(node);
        SimpleName excVariable = catchClause.getException().getName();
        if (excVariable!=null)
          cbc.add(excVariable);
        processBlock(catchClause.getBody(), context.setPrevious(catchStart), cbc);
        if (blockStack.pop() != cbc)
          throw new MethodCFGBuilderException("Different block context!!");
      }
    }
    acceptChild(node.getBody(), context);
View Full Code Here

TOP

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

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.