@Override public void visitCatch(JCCatch node) { set(node, new Catch() .rawExceptionDeclaration(toTree(node.getParameter(), FlagKey.VARDEF_IS_DEFINITION)) .rawBody(toTree(node.getBlock()))); }
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 void visitCatch(JCCatch node) { set(node, new Catch() .rawExceptionDeclaration(toTree(node.getParameter(), FlagKey.VARDEF_IS_DEFINITION)) .rawBody(toTree(node.getBlock()))); }
@Override public void visitCatch(JCCatch node) { set(node, new Catch() .rawExceptionDeclaration(toTree(node.getParameter(), FlagKey.VARDEF_IS_DEFINITION)) .rawBody(toTree(node.getBlock()))); }
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); } }
public Node createCatch(Node modifiers, Node type, Node varName, Node body) { VariableDefinitionEntry varNameEntry = new VariableDefinitionEntry().astName(createIdentifierIfNeeded(varName, currentPos())); if (varName != null) varNameEntry.setPosition(varName.getPosition()); VariableDefinition decl = new VariableDefinition().rawTypeReference(type).rawVariables().addToEnd( varNameEntry); if (type != null && varName != null) decl.setPosition(new Position(type.getPosition().getStart(), varName.getPosition().getEnd())); if (modifiers != null) decl.astModifiers(createModifiersIfNeeded(modifiers, currentPos())); return posify(new Catch().rawExceptionDeclaration(decl).rawBody(body)); }
public Node createCatch(Node modifiers, Node type, Node varName, Node body) { VariableDefinitionEntry varNameEntry = new VariableDefinitionEntry().astName(createIdentifierIfNeeded(varName, currentPos())); if (varName != null) varNameEntry.setPosition(varName.getPosition()); VariableDefinition decl = new VariableDefinition().rawTypeReference(type).rawVariables().addToEnd( varNameEntry); if (type != null && varName != null) decl.setPosition(new Position(type.getPosition().getStart(), varName.getPosition().getEnd())); if (modifiers != null) decl.astModifiers(createModifiersIfNeeded(modifiers, currentPos())); return posify(new Catch().rawExceptionDeclaration(decl).rawBody(body)); }
public Node createCatch(Node modifiers, Node type, Node varName, Node body) { VariableDefinitionEntry varNameEntry = new VariableDefinitionEntry().astName(createIdentifierIfNeeded(varName, currentPos())); if (varName != null) varNameEntry.setPosition(varName.getPosition()); VariableDefinition decl = new VariableDefinition().rawTypeReference(type).rawVariables().addToEnd( varNameEntry); if (type != null && varName != null) decl.setPosition(new Position(type.getPosition().getStart(), varName.getPosition().getEnd())); if (modifiers != null) decl.astModifiers(createModifiersIfNeeded(modifiers, currentPos())); return posify(new Catch().rawExceptionDeclaration(decl).rawBody(body)); }