6473148: TreePath.iterator() should document the iteration order
Reviewed-by: mcimadamore
--- a/langtools/src/share/classes/com/sun/source/util/TreePath.java Fri Jun 28 06:54:58 2013 -0400
+++ b/langtools/src/share/classes/com/sun/source/util/TreePath.java Fri Jun 28 13:20:44 2013 +0100
@@ -125,18 +125,25 @@
return parent;
}
+ /**
+ * Iterates from leaves to root.
+ */
+ @Override
public Iterator<Tree> iterator() {
return new Iterator<Tree>() {
+ @Override
public boolean hasNext() {
return next != null;
}
+ @Override
public Tree next() {
Tree t = next.leaf;
next = next.parent;
return t;
}
+ @Override
public void remove() {
throw new UnsupportedOperationException();
}