jdk/src/share/classes/javax/swing/JTree.java
changeset 5950 4beeac5abfed
parent 5506 202f599c92aa
child 7668 d4a77089c587
--- a/jdk/src/share/classes/javax/swing/JTree.java	Tue Jun 22 19:38:27 2010 +0400
+++ b/jdk/src/share/classes/javax/swing/JTree.java	Tue Jun 22 20:36:55 2010 +0400
@@ -1986,20 +1986,17 @@
      *               true if all nodes in the path are expanded
      */
     public boolean isExpanded(TreePath path) {
+
         if(path == null)
             return false;
-
-        // Is this node expanded?
-        Boolean value = expandedState.get(path);
-
-        if(value == null || !value.booleanValue())
-            return false;
-
-        // It is, make sure its parent is also expanded.
-        TreePath        parentPath = path.getParentPath();
-
-        if(parentPath != null)
-            return isExpanded(parentPath);
+        Object  value;
+
+        do{
+            value = expandedState.get(path);
+            if(value == null || !((Boolean)value).booleanValue())
+                return false;
+        } while( (path=path.getParentPath())!=null );
+
         return true;
     }