提交 0542bda4 编写于 作者: A alexp

6684401: JTree isExpanded should not call itself recursively

Reviewed-by: rupashka
上级 8fb38719
......@@ -1986,20 +1986,17 @@ public class JTree extends JComponent implements Scrollable, Accessible
* true if all nodes in the path are expanded
*/
public boolean isExpanded(TreePath path) {
if(path == null)
return false;
Object value;
// Is this node expanded?
Boolean value = expandedState.get(path);
if(value == null || !value.booleanValue())
do{
value = expandedState.get(path);
if(value == null || !((Boolean)value).booleanValue())
return false;
} while( (path=path.getParentPath())!=null );
// It is, make sure its parent is also expanded.
TreePath parentPath = path.getParentPath();
if(parentPath != null)
return isExpanded(parentPath);
return true;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册