changeset 1870:bb06c412d079

6473148: TreePath.iterator() should document the iteration order Reviewed-by: mcimadamore
author vromero
date Fri, 28 Jun 2013 13:20:44 +0100
parents 6101e52ce9e3
children bdd699d7378d
files src/share/classes/com/sun/source/util/TreePath.java
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/source/util/TreePath.java	Fri Jun 28 06:54:58 2013 -0400
+++ b/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();
             }