mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-16 13:25:34 +00:00
6684401: JTree isExpanded should not call itself recursively
Reviewed-by: rupashka
This commit is contained in:
parent
3e7a0f0bfd
commit
38241ca3a4
@ -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);
|
||||
do{
|
||||
value = expandedState.get(path);
|
||||
if(value == null || !((Boolean)value).booleanValue())
|
||||
return false;
|
||||
} while( (path=path.getParentPath())!=null );
|
||||
|
||||
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);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user