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); } }
private Node toVariableDefinition(List<AbstractVariableDeclaration> decls, Map<FlagKey, Object> params) { lombok.ast.VariableDefinition def = createVariableDefinition(decls, params); AbstractVariableDeclaration first = decls.get(0); def.setPosition(toPosition(first.declarationSourceStart, first.sourceEnd)); if (params.containsKey(FlagKey.AS_DEFINITION)) return def; lombok.ast.VariableDeclaration decl = new lombok.ast.VariableDeclaration(); if (first instanceof FieldDeclaration) { decl.astJavadoc((lombok.ast.Comment) toTree(((FieldDeclaration)first).javadoc)); } decl.astDefinition(def); decl.setPosition(toPosition(first.declarationSourceStart, first.declarationEnd)); return decl; }
private Node toVariableDefinition(List<AbstractVariableDeclaration> decls, Map<FlagKey, Object> params) { lombok.ast.VariableDefinition def = createVariableDefinition(decls, params); AbstractVariableDeclaration first = decls.get(0); def.setPosition(toPosition(first.declarationSourceStart, first.sourceEnd)); if (params.containsKey(FlagKey.AS_DEFINITION)) return def; lombok.ast.VariableDeclaration decl = new lombok.ast.VariableDeclaration(); if (first instanceof FieldDeclaration) { decl.astJavadoc((lombok.ast.Comment) toTree(((FieldDeclaration)first).javadoc)); } decl.astDefinition(def); decl.setPosition(toPosition(first.declarationSourceStart, first.declarationEnd)); return decl; }
private Node toVariableDefinition(List<AbstractVariableDeclaration> decls, Map<FlagKey, Object> params) { lombok.ast.VariableDefinition def = createVariableDefinition(decls, params); AbstractVariableDeclaration first = decls.get(0); def.setPosition(toPosition(first.declarationSourceStart, first.sourceEnd)); if (params.containsKey(FlagKey.AS_DEFINITION)) return def; lombok.ast.VariableDeclaration decl = new lombok.ast.VariableDeclaration(); if (first instanceof FieldDeclaration) { decl.astJavadoc((lombok.ast.Comment) toTree(((FieldDeclaration)first).javadoc)); } decl.astDefinition(def); decl.setPosition(toPosition(first.declarationSourceStart, first.declarationEnd)); return decl; }
def.astModifiers((Modifiers) toTree(first.mods)); setPos(decls.get(decls.size()-1), def); if (decls.size() > 1) def.setPosition(new Position(startPosFirst, def.getPosition().getEnd())); int baseDims = countDims(baseType); if ((first.mods.flags & Flags.VARARGS) != 0) {
def.astModifiers((Modifiers) toTree(first.mods)); setPos(decls.get(decls.size()-1), def); if (decls.size() > 1) def.setPosition(new Position(startPosFirst, def.getPosition().getEnd())); int baseDims = countDims(baseType); if ((first.mods.flags & Flags.VARARGS) != 0) {
def.astModifiers((Modifiers) toTree(first.mods)); setPos(decls.get(decls.size()-1), def); if (decls.size() > 1) def.setPosition(new Position(startPosFirst, def.getPosition().getEnd())); int baseDims = countDims(baseType); if ((first.mods.flags & Flags.VARARGS) != 0) {
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)); }