From 99a38d4d08cb020182663ffaf9418d28becf1fd6 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Wed, 24 Jun 2009 01:22:08 +0200 Subject: Added proper support for changing the AST as its being visited, both removal and addition. The rule is now: children traversal traverses through the tree mostly as it was when it started. --- src/lombok/javac/JavacAST.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lombok/javac/JavacAST.java') diff --git a/src/lombok/javac/JavacAST.java b/src/lombok/javac/JavacAST.java index f0544256..ad2be523 100644 --- a/src/lombok/javac/JavacAST.java +++ b/src/lombok/javac/JavacAST.java @@ -69,7 +69,7 @@ public class JavacAST extends AST { } private void traverseChildren(JavacASTVisitor visitor, Node node) { - for ( Node child : node.down() ) { + for ( Node child : new ArrayList(node.down()) ) { child.traverse(visitor); } } @@ -357,7 +357,7 @@ public class JavacAST extends AST { /** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public Collection down() { - return (Collection) children; + return (Collection) super.down(); } public void addError(String message) { -- cgit