@SuppressWarnings("unchecked") public boolean visit(VariableDeclarationStatement node) { node.fragments().stream().forEach(fragment -> importer .ensureLocalVariableFromFragment((VariableDeclarationFragment) fragment, node.getType())); return true; }
public boolean visit(VariableDeclarationStatement node) { System.out.println("Visiting variable declaration statement."); for(int i = 0; i < node.fragments().size(); ++i) { VariableDeclarationFragment frag = (VariableDeclarationFragment)node.fragments().get(i); System.out.println("Fragment: " + node.getType() + " " + frag.getName()); } System.out.println(""); return true; }
@Override public void endVisit(VariableDeclarationStatement node) { checkTypeInDeclaration(node.getType()); super.endVisit(node); }
final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { if (property == TYPE_PROPERTY) { if (get) { return getType(); } else { setType((Type) child); return null; } } // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); }
@Override public void endVisit(VariableDeclarationStatement node) { // TODO: in principle, no need to tie the VariableDeclarationFragments together. // The VariableDeclarationExpression can be split up when fragments get different types. // Warning: still need to connect fragments with type! endVisitFieldVariableDeclaration(node.getType(), node.fragments()); }
final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { if (property == TYPE_PROPERTY) { if (get) { return getType(); } else { setType((Type) child); return null; } } // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); }
@Override public void endVisit(VariableDeclarationStatement node) { checkTypeInDeclaration(node.getType()); super.endVisit(node); }
@Override public void endVisit(VariableDeclarationStatement node) { if (skipNode(node)) { return; } GenericSequentialFlowInfo info = processSequential(node, node.getType()); process(info, node.fragments()); }
private Type getType(ASTNode node) { if (node instanceof VariableDeclarationStatement) { final VariableDeclarationStatement vds = (VariableDeclarationStatement) node; return this.ctx.getASTBuilder().copy(vds.getType()); } return getType(node.getParent()); }
@Override public void endVisit(VariableDeclarationStatement node) { if (skipNode(node)) return; GenericSequentialFlowInfo info= processSequential(node, node.getType()); process(info, node.fragments()); }
int treeSize() { return memSize() + (this.modifiers == null ? 0 : this.modifiers.listSize()) + (this.baseType == null ? 0 : getType().treeSize()) + this.variableDeclarationFragments.listSize(); } }
int treeSize() { return memSize() + (this.modifiers == null ? 0 : this.modifiers.listSize()) + (this.baseType == null ? 0 : getType().treeSize()) + this.variableDeclarationFragments.listSize(); } }
@Override int treeSize() { return memSize() + (this.modifiers == null ? 0 : this.modifiers.listSize()) + (this.baseType == null ? 0 : getType().treeSize()) + this.variableDeclarationFragments.listSize(); } }
public void endVisit(VariableDeclarationStatement node) { if (skipNode(node)) return; GenericSequentialFlowInfo info= processSequential(node, node.getType()); process(info, node.fragments()); }
@Override public boolean visit(final VariableDeclarationStatement node) { final ASTNode parent = node.getParent(); for (final Object fragment : node.fragments()) { final VariableDeclarationFragment frag = (VariableDeclarationFragment) fragment; variableScopes.put(parent, new Variable(frag.getName() .getIdentifier(), node.getType().toString(), ScopeType.SCOPE_LOCAL)); } return false; }
private void refactorWrapper(final VariableDeclarationStatement node) { final ASTBuilder b = this.ctx.getASTBuilder(); final Type primitiveType = b.type(getPrimitiveTypeName()); ctx.getRefactorings().replace(node.getType(), primitiveType); }
void accept0(ASTVisitor visitor) { boolean visitChildren = visitor.visit(this); if (visitChildren) { // visit children in normal left to right reading order if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { acceptChildren(visitor, this.modifiers); } acceptChild(visitor, getType()); acceptChildren(visitor, this.variableDeclarationFragments); } visitor.endVisit(this); }
public void endVisit(FieldDeclaration node) { // TODO: in principle, no need to tie the VariableDeclarationFragments together. // The FieldDeclaration can be split up when fragments get different types. // Warning: still need to connect fragments with type! endVisitFieldVariableDeclaration(node.getType(), node.fragments()); }
@Override void accept0(ASTVisitor visitor) { boolean visitChildren = visitor.visit(this); if (visitChildren) { // visit children in normal left to right reading order if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { acceptChildren(visitor, this.modifiers); } acceptChild(visitor, getType()); acceptChildren(visitor, this.variableDeclarationFragments); } visitor.endVisit(this); }
void accept0(ASTVisitor visitor) { boolean visitChildren = visitor.visit(this); if (visitChildren) { // visit children in normal left to right reading order if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { acceptChildren(visitor, this.modifiers); } acceptChild(visitor, getType()); acceptChildren(visitor, this.variableDeclarationFragments); } visitor.endVisit(this); }