diff options
author | Reinier Zwitserloot <reinier@tipit.to> | 2009-06-24 01:22:08 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@tipit.to> | 2009-06-24 01:22:08 +0200 |
commit | 99a38d4d08cb020182663ffaf9418d28becf1fd6 (patch) | |
tree | 8831e47ab817d5783f868e0f11905632faaeca5c /src/lombok/javac | |
parent | c834e09af460715a159506c5e809b3572dc22de5 (diff) | |
download | lombok-99a38d4d08cb020182663ffaf9418d28becf1fd6.tar.gz lombok-99a38d4d08cb020182663ffaf9418d28becf1fd6.tar.bz2 lombok-99a38d4d08cb020182663ffaf9418d28becf1fd6.zip |
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.
Diffstat (limited to 'src/lombok/javac')
-rw-r--r-- | src/lombok/javac/JavacAST.java | 4 |
1 files changed, 2 insertions, 2 deletions
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<JCTree> { } private void traverseChildren(JavacASTVisitor visitor, Node node) { - for ( Node child : node.down() ) { + for ( Node child : new ArrayList<Node>(node.down()) ) { child.traverse(visitor); } } @@ -357,7 +357,7 @@ public class JavacAST extends AST<JCTree> { /** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public Collection<Node> down() { - return (Collection<Node>) children; + return (Collection<Node>) super.down(); } public void addError(String message) { |