@Override public boolean visitCatch(Catch node) { JCVariableDecl exceptionDeclaration = (JCVariableDecl) toTree(node.astExceptionDeclaration()); exceptionDeclaration.getModifiers().flags |= Flags.PARAMETER; return posSet(node, treeMaker.Catch(exceptionDeclaration, (JCBlock) toTree(node.astBody()))); }
@Override public boolean visitCatch(Catch node) { JCVariableDecl exceptionDeclaration = (JCVariableDecl) toTree(node.astExceptionDeclaration()); exceptionDeclaration.getModifiers().flags |= Flags.PARAMETER; return posSet(node, treeMaker.Catch(exceptionDeclaration, (JCBlock) toTree(node.astBody()))); }
@Override public boolean visitCatch(Catch node) { JCVariableDecl exceptionDeclaration = (JCVariableDecl) toTree(node.astExceptionDeclaration()); exceptionDeclaration.getModifiers().flags |= Flags.PARAMETER; return posSet(node, treeMaker.Catch(exceptionDeclaration, (JCBlock) toTree(node.astBody()))); }
private void toCatches(Argument[] catchArguments, Block[] catchBlocks, StrictListAccessor<lombok.ast.Catch, lombok.ast.Try> astCatches) { if (catchArguments == null || catchBlocks == null || (catchBlocks.length != catchArguments.length)) { return; } for (int i = 0; i < catchBlocks.length; i++) { lombok.ast.Catch cat = new lombok.ast.Catch(); VariableDefinition catchArg = (VariableDefinition) toTree(catchArguments[i]); catchArg.setPosition(toPosition(catchArguments[i].declarationSourceStart, catchArguments[i].sourceEnd)); cat.astExceptionDeclaration(catchArg); cat.astBody((lombok.ast.Block) toTree(catchBlocks[i])); astCatches.addToEnd(cat); } }
private void toCatches(Argument[] catchArguments, Block[] catchBlocks, StrictListAccessor<lombok.ast.Catch, lombok.ast.Try> astCatches) { if (catchArguments == null || catchBlocks == null || (catchBlocks.length != catchArguments.length)) { return; } for (int i = 0; i < catchBlocks.length; i++) { lombok.ast.Catch cat = new lombok.ast.Catch(); VariableDefinition catchArg = (VariableDefinition) toTree(catchArguments[i]); catchArg.setPosition(toPosition(catchArguments[i].declarationSourceStart, catchArguments[i].sourceEnd)); cat.astExceptionDeclaration(catchArg); cat.astBody((lombok.ast.Block) toTree(catchBlocks[i])); astCatches.addToEnd(cat); } }
private void toCatches(Argument[] catchArguments, Block[] catchBlocks, StrictListAccessor<lombok.ast.Catch, lombok.ast.Try> astCatches) { if (catchArguments == null || catchBlocks == null || (catchBlocks.length != catchArguments.length)) { return; } for (int i = 0; i < catchBlocks.length; i++) { lombok.ast.Catch cat = new lombok.ast.Catch(); VariableDefinition catchArg = (VariableDefinition) toTree(catchArguments[i]); catchArg.setPosition(toPosition(catchArguments[i].declarationSourceStart, catchArguments[i].sourceEnd)); cat.astExceptionDeclaration(catchArg); cat.astBody((lombok.ast.Block) toTree(catchBlocks[i])); astCatches.addToEnd(cat); } }
@Override public boolean visitTry(lombok.ast.Try node) { TryStatement tryStatement = new TryStatement(); tryStatement.sourceStart = start(node); tryStatement.sourceEnd = end(node); tryStatement.tryBlock = (Block) toTree(node.astBody()); int catchSize = node.astCatches().size(); if (catchSize > 0) { tryStatement.catchArguments = new Argument[catchSize]; tryStatement.catchBlocks = new Block[catchSize]; int i = 0; for (lombok.ast.Catch c : node.astCatches()) { tryStatement.catchArguments[i] = (Argument)toTree(c.astExceptionDeclaration()); tryStatement.catchBlocks[i] = (Block) toTree(c.astBody()); i++; } } tryStatement.finallyBlock = (Block) toTree(node.astFinally()); return set(node, tryStatement); }
@Override public boolean visitTry(lombok.ast.Try node) { TryStatement tryStatement = new TryStatement(); tryStatement.sourceStart = start(node); tryStatement.sourceEnd = end(node); tryStatement.tryBlock = (Block) toTree(node.astBody()); int catchSize = node.astCatches().size(); if (catchSize > 0) { tryStatement.catchArguments = new Argument[catchSize]; tryStatement.catchBlocks = new Block[catchSize]; int i = 0; for (lombok.ast.Catch c : node.astCatches()) { tryStatement.catchArguments[i] = (Argument)toTree(c.astExceptionDeclaration()); tryStatement.catchBlocks[i] = (Block) toTree(c.astBody()); i++; } } tryStatement.finallyBlock = (Block) toTree(node.astFinally()); return set(node, tryStatement); }
@Override public boolean visitTry(lombok.ast.Try node) { TryStatement tryStatement = new TryStatement(); tryStatement.sourceStart = start(node); tryStatement.sourceEnd = end(node); tryStatement.tryBlock = (Block) toTree(node.astBody()); int catchSize = node.astCatches().size(); if (catchSize > 0) { tryStatement.catchArguments = new Argument[catchSize]; tryStatement.catchBlocks = new Block[catchSize]; int i = 0; for (lombok.ast.Catch c : node.astCatches()) { tryStatement.catchArguments[i] = (Argument)toTree(c.astExceptionDeclaration()); tryStatement.catchBlocks[i] = (Block) toTree(c.astBody()); i++; } } tryStatement.finallyBlock = (Block) toTree(node.astFinally()); return set(node, tryStatement); }