@Override public boolean visitTry(Try node) { List<JCCatch> catches = toList(JCCatch.class, node.astCatches()); return posSet(node, treeMaker.Try((JCBlock) toTree(node.astBody()), catches, (JCBlock) toTree(node.astFinally()))); }
public Node createTryStatement(Node body, List<Node> catches, Node finallyBody) { Try result = new Try().rawBody(body).rawFinally(finallyBody); if (catches != null) for (Node c : catches) if (c != null) result.rawCatches().addToEnd(c); return posify(result); }
public void checkNotLoneTry(Try node) { if (node.rawCatches().size() == 0 && node.rawFinally() == null) { node.addMessage(error(TRY_LONE_TRY, "try statement with no catches and no finally")); } }
@Override public void visitTryStatement(TryStatement node) { lombok.ast.Try tryStat = new lombok.ast.Try(); tryStat.astBody((lombok.ast.Block) toTree(node.tryBlock)); tryStat.astFinally((lombok.ast.Block) toTree(node.finallyBlock)); toCatches(node.catchArguments, node.catchBlocks, tryStat.astCatches()); set(node, setPosition(node, tryStat)); }
@Override public boolean visitTry(Try node) { formatter.buildBlock(node); formatter.keyword("try"); formatter.space(); formatter.startSuppressBlock(); formatter.nameNextElement("try"); visit(node.rawBody()); formatter.endSuppressBlock(); visitAll(node.rawCatches(), " ", " ", ""); if (node.rawFinally() != null) { formatter.space(); formatter.keyword("finally"); formatter.space(); formatter.startSuppressBlock(); formatter.nameNextElement("finally"); visit(node.rawFinally()); formatter.endSuppressBlock(); } formatter.closeBlock(); return true; }
if (catchArguments.length > 1) { int index = 0; for (Catch aCatch : aTry.astCatches()) { if (aCatch == catchBlock) { if (index < catchArguments.length) {
@Override public boolean visitTry(Try node) { Object nativeNode = node.getNativeNode(); if (nativeNode != null && nativeNode.getClass().getName().equals( "org.eclipse.jdt.internal.compiler.ast.TryStatement")) { for (Catch c : node.astCatches()) { VariableDefinition variableDefinition = c.astExceptionDeclaration(); TypeReference typeReference = variableDefinition.astTypeReference();
@Override public void visitTryStatement(TryStatement node) { lombok.ast.Try tryStat = new lombok.ast.Try(); tryStat.astBody((lombok.ast.Block) toTree(node.tryBlock)); tryStat.astFinally((lombok.ast.Block) toTree(node.finallyBlock)); toCatches(node.catchArguments, node.catchBlocks, tryStat.astCatches()); set(node, setPosition(node, tryStat)); }
@Override public boolean visitTry(Try node) { formatter.buildBlock(node); formatter.keyword("try"); formatter.space(); formatter.startSuppressBlock(); formatter.nameNextElement("try"); visit(node.rawBody()); formatter.endSuppressBlock(); visitAll(node.rawCatches(), " ", " ", ""); if (node.rawFinally() != null) { formatter.space(); formatter.keyword("finally"); formatter.space(); formatter.startSuppressBlock(); formatter.nameNextElement("finally"); visit(node.rawFinally()); formatter.endSuppressBlock(); } formatter.closeBlock(); return true; }
break; } else { for (Catch aCatch : tryCatch.astCatches()) { TypeReference catchType = aCatch.astExceptionDeclaration().astTypeReference();
public Node createTryStatement(Node body, List<Node> catches, Node finallyBody) { Try result = new Try().rawBody(body).rawFinally(finallyBody); if (catches != null) for (Node c : catches) if (c != null) result.rawCatches().addToEnd(c); return posify(result); }
@Override public boolean visitTry(Try node) { List<JCCatch> catches = toList(JCCatch.class, node.astCatches()); return posSet(node, treeMaker.Try((JCBlock) toTree(node.astBody()), catches, (JCBlock) toTree(node.astFinally()))); }
@Override public void visitTryStatement(TryStatement node) { lombok.ast.Try tryStat = new lombok.ast.Try(); tryStat.astBody((lombok.ast.Block) toTree(node.tryBlock)); tryStat.astFinally((lombok.ast.Block) toTree(node.finallyBlock)); toCatches(node.catchArguments, node.catchBlocks, tryStat.astCatches()); set(node, setPosition(node, tryStat)); }
public void checkNotLoneTry(Try node) { if (node.rawCatches().size() == 0 && node.rawFinally() == null) { node.addMessage(error(TRY_LONE_TRY, "try statement with no catches and no finally")); } }
@Override public boolean visitTry(Try node) { formatter.buildBlock(node); formatter.keyword("try"); formatter.space(); formatter.startSuppressBlock(); formatter.nameNextElement("try"); visit(node.rawBody()); formatter.endSuppressBlock(); visitAll(node.rawCatches(), " ", " ", ""); if (node.rawFinally() != null) { formatter.space(); formatter.keyword("finally"); formatter.space(); formatter.startSuppressBlock(); formatter.nameNextElement("finally"); visit(node.rawFinally()); formatter.endSuppressBlock(); } formatter.closeBlock(); return true; }
break; } else { for (Catch aCatch : tryCatch.astCatches()) { TypeReference catchType = aCatch.astExceptionDeclaration(). astTypeReference();
public Node createTryStatement(Node body, List<Node> catches, Node finallyBody) { Try result = new Try().rawBody(body).rawFinally(finallyBody); if (catches != null) for (Node c : catches) if (c != null) result.rawCatches().addToEnd(c); return posify(result); }
@Override public boolean visitTry(Try node) { List<JCCatch> catches = toList(JCCatch.class, node.astCatches()); return posSet(node, treeMaker.Try((JCBlock) toTree(node.astBody()), catches, (JCBlock) toTree(node.astFinally()))); }
public void checkNotLoneTry(Try node) { if (node.rawCatches().size() == 0 && node.rawFinally() == null) { node.addMessage(error(TRY_LONE_TRY, "try statement with no catches and no finally")); } }
@Override public void visitTry(JCTry node) { Try t = new Try(); t.rawBody(toTree(node.getBlock())); t.rawFinally(toTree(node.getFinallyBlock())); fillList(node.getCatches(), t.rawCatches()); set(node, t); }