langtools/src/share/classes/com/sun/source/util/TreePath.java
changeset 3149 0cd06d598d6f
parent 10 06bc494ca11e
child 5520 86e4b9a9da40
--- 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;
         };
     }