protected void addExceptions(ITypeBinding[] exceptions, AST ast) { if(exceptions == null) return; for (int i= 0; i < exceptions.length;i++) { addException(exceptions[i], ast); } }
protected void addExceptions(ITypeBinding[] exceptions) { if(exceptions == null) return; for (int i= 0; i < exceptions.length;i++) { addException(exceptions[i]); } }
protected void addExceptions(ITypeBinding[] exceptions, AST ast) { if(exceptions == null) return; for (int i= 0; i < exceptions.length;i++) { addException(exceptions[i], ast); } }
public boolean visit(TryStatement node) { fCurrentExceptions= new ArrayList(1); fTryStack.push(fCurrentExceptions); // visit try block node.getBody().accept(this); // Remove those exceptions that get catch by following catch blocks List catchClauses= node.catchClauses(); if (!catchClauses.isEmpty()) handleCatchArguments(catchClauses); List current= (List)fTryStack.pop(); fCurrentExceptions= (List)fTryStack.peek(); for (Iterator iter= current.iterator(); iter.hasNext();) { addException((ITypeBinding)iter.next()); } // visit catch and finally for (Iterator iter= catchClauses.iterator(); iter.hasNext(); ) { ((CatchClause)iter.next()).accept(this); } if (node.getFinally() != null) node.getFinally().accept(this); // return false. We have visited the body by ourselves. return false; }
@Override public boolean visit(TryStatement node) { fCurrentExceptions= new ArrayList<>(1); fTryStack.push(fCurrentExceptions); // visit try block node.getBody().accept(this); List<Expression> resources= node.resources(); for (Iterator<Expression> iterator= resources.iterator(); iterator.hasNext();) { iterator.next().accept(this); } // Remove those exceptions that get catch by following catch blocks List<CatchClause> catchClauses= node.catchClauses(); if (!catchClauses.isEmpty()) handleCatchArguments(catchClauses); List<ITypeBinding> current= fTryStack.pop(); fCurrentExceptions= fTryStack.peek(); for (Iterator<ITypeBinding> iter= current.iterator(); iter.hasNext();) { addException(iter.next(), node.getAST()); } // visit catch and finally for (Iterator<CatchClause> iter= catchClauses.iterator(); iter.hasNext(); ) { iter.next().accept(this); } if (node.getFinally() != null) node.getFinally().accept(this); // return false. We have visited the body by ourselves. return false; }
@Override public boolean visit(TryStatement node) { fCurrentExceptions= new ArrayList<>(1); fTryStack.push(fCurrentExceptions); // visit try block node.getBody().accept(this); List<VariableDeclarationExpression> resources= node.resources(); for (Iterator<VariableDeclarationExpression> iterator= resources.iterator(); iterator.hasNext();) { iterator.next().accept(this); } // Remove those exceptions that get catch by following catch blocks List<CatchClause> catchClauses= node.catchClauses(); if (!catchClauses.isEmpty()) handleCatchArguments(catchClauses); List<ITypeBinding> current= fTryStack.pop(); fCurrentExceptions= fTryStack.peek(); for (Iterator<ITypeBinding> iter= current.iterator(); iter.hasNext();) { addException(iter.next(), node.getAST()); } // visit catch and finally for (Iterator<CatchClause> iter= catchClauses.iterator(); iter.hasNext(); ) { iter.next().accept(this); } if (node.getFinally() != null) node.getFinally().accept(this); // return false. We have visited the body by ourselves. return false; }