@Override public void clear() { for (final T item : this) { item.remove(); } }
@Override public void clear() { for (final T item : this) { item.remove(); } }
@Override public void clear() { for (final T item : this) { item.remove(); } }
@Override public boolean remove(final Object o) { if (contains(o)) { ((AstNode) o).remove(); return true; } return false; }
@Override public boolean remove(final Object o) { if (contains(o)) { ((AstNode) o).remove(); return true; } return false; }
public void moveTo(final Collection<T> destination) { VerifyArgument.notNull(destination, "destination"); for (final T node : this) { node.remove(); destination.add(node); } }
public void moveTo(final Collection<T> destination) { VerifyArgument.notNull(destination, "destination"); for (final T node : this) { node.remove(); destination.add(node); } }
@Override public boolean remove(final Object o) { if (contains(o)) { ((AstNode) o).remove(); return true; } return false; }
public void moveTo(final Collection<T> destination) { VerifyArgument.notNull(destination, "destination"); for (final T node : this) { node.remove(); destination.add(node); } }
@Override public void run(final AstNode compilationUnit) { // // First run through and locate any outer class member access methods. // new PhaseOneVisitor().run(compilationUnit); super.run(compilationUnit); for (final AstNode node : _nodesToRemove) { node.remove(); } }
@Override public void run(final AstNode compilationUnit) { // // First run through and locate any outer class member access$ methods. // new PhaseOneVisitor().run(compilationUnit); super.run(compilationUnit); for (final AstNode node : _nodesToRemove) { node.remove(); } }
@Override public void run(final AstNode compilationUnit) { // // First run through and locate any outer class member access$ methods. // new PhaseOneVisitor().run(compilationUnit); super.run(compilationUnit); for (final AstNode node : _nodesToRemove) { node.remove(); } }
@Override public void run(final AstNode compilationUnit) { // // First run through and locate any outer class member access methods. // new PhaseOneVisitor().run(compilationUnit); super.run(compilationUnit); for (final AstNode node : _nodesToRemove) { node.remove(); } }
@Override public void run(final AstNode compilationUnit) { // // First run through and locate any outer class member access$ methods. // new PhaseOneVisitor().run(compilationUnit); super.run(compilationUnit); for (final AstNode node : _nodesToRemove) { node.remove(); } }
@Override public void run(final AstNode compilationUnit) { // // First run through and locate any outer class member access methods. // new PhaseOneVisitor().run(compilationUnit); super.run(compilationUnit); for (final AstNode node : _nodesToRemove) { node.remove(); } }
public void run(final AstNode root) { if (!(root instanceof MethodDeclaration)) { throw new IllegalArgumentException("InliningVisitor must be run against a MethodDeclaration."); } final MethodDeclaration clone = (MethodDeclaration) root.clone(); super.run(clone); final BlockStatement body = clone.getBody(); final AstNodeCollection<Statement> statements = body.getStatements(); if (statements.size() == 1) { final Statement firstStatement = statements.firstOrNullObject(); if (firstStatement instanceof ExpressionStatement || firstStatement instanceof ReturnStatement) { _result = firstStatement.getChildByRole(Roles.EXPRESSION); _result.remove(); return; } } _result = body; _result.remove(); }
public void run(final AstNode root) { if (!(root instanceof MethodDeclaration)) { throw new IllegalArgumentException("InliningVisitor must be run against a MethodDeclaration."); } final MethodDeclaration clone = (MethodDeclaration) root.clone(); super.run(clone); final BlockStatement body = clone.getBody(); final AstNodeCollection<Statement> statements = body.getStatements(); if (statements.size() == 1) { final Statement firstStatement = statements.firstOrNullObject(); if (firstStatement instanceof ExpressionStatement || firstStatement instanceof ReturnStatement) { _result = firstStatement.getChildByRole(Roles.EXPRESSION); _result.remove(); return; } } _result = body; _result.remove(); }
public static void replaceAll(final AstNode tree) { for (final AstNode node : tree.getDescendants()) { if (node instanceof CommentStatement) { node.getParent().insertChildBefore( node, new Comment(((CommentStatement) node).getComment()), Roles.COMMENT ); node.remove(); } } }
public static void replaceAll(final AstNode tree) { for (final AstNode node : tree.getDescendants()) { if (node instanceof CommentStatement) { node.getParent().insertChildBefore( node, new Comment(((CommentStatement) node).getComment()), Roles.COMMENT ); node.remove(); } } }
public static void replaceAll(final AstNode tree) { for (final AstNode node : tree.getDescendants()) { if (node instanceof CommentStatement) { node.getParent().insertChildBefore( node, new Comment(((CommentStatement) node).getComment()), Roles.COMMENT ); node.remove(); } } }