--- a/langtools/src/share/classes/com/sun/source/util/TreePath.java Fri Jun 26 12:22:40 2009 -0700
+++ b/langtools/src/share/classes/com/sun/source/util/TreePath.java Fri Jun 26 18:51:39 2009 -0700
@@ -120,19 +120,20 @@
public Iterator<Tree> iterator() {
return new Iterator<Tree>() {
public boolean hasNext() {
- return curr.parent != null;
+ return next != null;
}
public Tree next() {
- curr = curr.parent;
- return curr.leaf;
+ Tree t = next.leaf;
+ next = next.parent;
+ return t;
}
public void remove() {
throw new UnsupportedOperationException();
}
- private TreePath curr;
+ private TreePath next = TreePath.this;
};
}