public boolean visit(VariableDeclarationStatement node) { for (Object f : node.fragments()) { VariableDeclarationFragment variable = (VariableDeclarationFragment) f; addStatement(new CSDeclarationStatement(node.getStartPosition(), createVariableDeclaration(variable))); } return false; }
/** * Declaration of the variable within a block */ @Override public boolean visit(VariableDeclarationStatement node) { for (int i = 0; i < node.fragments().size(); ++i) { String nodeType = node.getType().toString(); VariableDeclarationFragment frag = (VariableDeclarationFragment) node.fragments().get(i); state.getNames().add(frag.getName().getIdentifier()); state.getNameInstance().put(frag.getName().toString(), nodeType.toString()); } processType(node.getType(), TypeReferenceLocation.VARIABLE_DECLARATION, compilationUnit.getLineNumber(node.getStartPosition()), compilationUnit.getColumnNumber(node.getStartPosition()), node.getLength(), node.toString()); return super.visit(node); }
public boolean visit(VariableDeclarationStatement node) { if (!hasChildrenChanges(node)) { return doVisitUnchangedChildren(node); } // same code as FieldDeclaration int pos= node.getStartPosition(); if (node.getAST().apiLevel() == JLS2_INTERNAL) { rewriteModifiers(node, INTERNAL_VDS_MODIFIERS_PROPERTY, pos); } else { rewriteModifiers2(node, VariableDeclarationStatement.MODIFIERS2_PROPERTY, pos); } pos= rewriteRequiredNode(node, VariableDeclarationStatement.TYPE_PROPERTY); rewriteNodeList(node, VariableDeclarationStatement.FRAGMENTS_PROPERTY, pos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$ return false; }
@Override public boolean visit(VariableDeclarationStatement node) { if (!hasChildrenChanges(node)) { return doVisitUnchangedChildren(node); } // same code as FieldDeclaration int pos= node.getStartPosition(); if (node.getAST().apiLevel() == JLS2_INTERNAL) { rewriteModifiers(node, INTERNAL_VDS_MODIFIERS_PROPERTY, pos); } else { rewriteModifiers2(node, VariableDeclarationStatement.MODIFIERS2_PROPERTY, pos); } pos= rewriteRequiredNode(node, VariableDeclarationStatement.TYPE_PROPERTY); rewriteNodeList(node, VariableDeclarationStatement.FRAGMENTS_PROPERTY, pos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$ return false; }
public boolean visit(VariableDeclarationStatement node) { if (!hasChildrenChanges(node)) { return doVisitUnchangedChildren(node); } // same code as FieldDeclaration int pos= node.getStartPosition(); if (node.getAST().apiLevel() == JLS2_INTERNAL) { rewriteModifiers(node, INTERNAL_VDS_MODIFIERS_PROPERTY, pos); } else { rewriteModifiers2(node, VariableDeclarationStatement.MODIFIERS2_PROPERTY, pos); } pos= rewriteRequiredNode(node, VariableDeclarationStatement.TYPE_PROPERTY); rewriteNodeList(node, VariableDeclarationStatement.FRAGMENTS_PROPERTY, pos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$ return false; }
ASTNode clone0(AST target) { VariableDeclarationStatement result = new VariableDeclarationStatement(target); result.setSourceRange(getStartPosition(), getLength()); result.copyLeadingComment(this); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.setModifiers(getModifiers()); } if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); } result.setType((Type) getType().clone(target)); result.fragments().addAll( ASTNode.copySubtrees(target, fragments())); return result; }
ASTNode clone0(AST target) { VariableDeclarationStatement result = new VariableDeclarationStatement(target); result.setSourceRange(getStartPosition(), getLength()); result.copyLeadingComment(this); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.setModifiers(getModifiers()); } if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); } result.setType((Type) getType().clone(target)); result.fragments().addAll( ASTNode.copySubtrees(target, fragments())); return result; }
public boolean visit(VariableDeclarationStatement node) { if (!hasChildrenChanges(node)) { return doVisitUnchangedChildren(node); } // same code as FieldDeclaration int pos= node.getStartPosition(); if (node.getAST().apiLevel() == JLS2_INTERNAL) { rewriteModifiers(node, INTERNAL_VDS_MODIFIERS_PROPERTY, pos); } else { rewriteModifiers2(node, VariableDeclarationStatement.MODIFIERS2_PROPERTY, pos); } pos= rewriteRequiredNode(node, VariableDeclarationStatement.TYPE_PROPERTY); rewriteNodeList(node, VariableDeclarationStatement.FRAGMENTS_PROPERTY, pos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$ return false; }
ASTNode clone0(AST target) { VariableDeclarationStatement result = new VariableDeclarationStatement(target); result.setSourceRange(getStartPosition(), getLength()); result.copyLeadingComment(this); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.setModifiers(getModifiers()); } if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); } result.setType((Type) getType().clone(target)); result.fragments().addAll( ASTNode.copySubtrees(target, fragments())); return result; }
ASTNode clone0(AST target) { VariableDeclarationStatement result = new VariableDeclarationStatement(target); result.setSourceRange(getStartPosition(), getLength()); result.copyLeadingComment(this); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.setModifiers(getModifiers()); } if (this.ast.apiLevel >= AST.JLS3) { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); } result.setType((Type) getType().clone(target)); result.fragments().addAll( ASTNode.copySubtrees(target, fragments())); return result; }
public boolean visit(VariableDeclarationStatement node) { if (!hasChildrenChanges(node)) { return doVisitUnchangedChildren(node); } // same code as FieldDeclaration int pos= node.getStartPosition(); if (node.getAST().apiLevel() == JLS2_INTERNAL) { rewriteModifiers(node, VariableDeclarationStatement.MODIFIERS_PROPERTY, pos); } else { rewriteModifiers2(node, VariableDeclarationStatement.MODIFIERS2_PROPERTY, pos); } pos= rewriteRequiredNode(node, VariableDeclarationStatement.TYPE_PROPERTY); rewriteNodeList(node, VariableDeclarationStatement.FRAGMENTS_PROPERTY, pos, "", ", "); //$NON-NLS-1$ //$NON-NLS-2$ return false; }
public boolean visit(VariableDeclarationStatement node) { if (!hasChildrenChanges(node)) { return doVisitUnchangedChildren(node); } // same code as FieldDeclaration int pos= node.getStartPosition(); if (node.getAST().apiLevel() == JLS2_INTERNAL) { rewriteModifiers(node, INTERNAL_VDS_MODIFIERS_PROPERTY, pos); } else { rewriteModifiers2(node, VariableDeclarationStatement.MODIFIERS2_PROPERTY, pos); } pos= rewriteRequiredNode(node, VariableDeclarationStatement.TYPE_PROPERTY); rewriteNodeList(node, VariableDeclarationStatement.FRAGMENTS_PROPERTY, pos, Util.EMPTY_STRING, ", "); //$NON-NLS-1$ return false; }
ASTNode clone0(AST target) { VariableDeclarationStatement result = new VariableDeclarationStatement(target); result.setSourceRange(getStartPosition(), getLength()); result.copyLeadingComment(this); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.setModifiers(getModifiers()); } if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); } result.setType((Type) getType().clone(target)); result.fragments().addAll( ASTNode.copySubtrees(target, fragments())); return result; }
@Override ASTNode clone0(AST target) { VariableDeclarationStatement result = new VariableDeclarationStatement(target); result.setSourceRange(getStartPosition(), getLength()); result.copyLeadingComment(this); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.setModifiers(getModifiers()); } if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); } result.setType((Type) getType().clone(target)); result.fragments().addAll( ASTNode.copySubtrees(target, fragments())); return result; }
int extendedStart= root.getExtendedStartPosition(statement); if (extendedStart != statement.getStartPosition() && extendedStart >= fSelection.getOffset()) { String commentToken= document.get(extendedStart, statement.getStartPosition() - extendedStart); commentToken= Strings.trimTrailingTabsAndSpaces(commentToken); Type type= statement.getType();
int extendedStart = root.getExtendedStartPosition(statement); if (extendedStart != statement.getStartPosition() && extendedStart >= fSelection.getOffset()) { String commentToken = buffer.getText(extendedStart, statement.getStartPosition() - extendedStart); commentToken = Strings.trimTrailingTabsAndSpaces(commentToken); Type type = statement.getType();
int extendedStart= root.getExtendedStartPosition(statement); if (extendedStart != statement.getStartPosition() && extendedStart >= fSelection.getOffset()) { String commentToken= buffer.getText(extendedStart, statement.getStartPosition() - extendedStart); commentToken= Strings.trimTrailingTabsAndSpaces(commentToken); Type type= statement.getType();
int extendedStart= root.getExtendedStartPosition(statement); if (extendedStart != statement.getStartPosition() && extendedStart >= fSelection.getOffset()) { String commentToken= buffer.getText(extendedStart, statement.getStartPosition() - extendedStart); commentToken= Strings.trimTrailingTabsAndSpaces(commentToken); Type type= statement.getType();