Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6684401
Votes 0
Synopsis JTree isExpanded should not call itself recursively
Category java:classes_swing
Reported Against
Release Fixed 6u7-rev(b12)
State 10-Fix Delivered, bug
Priority: 2-High
Related Bugs
Submit Date 04-APR-2008
Description
FULL PRODUCT VERSION :
java version "1.6.0_02"
Java(TM) SE Runtime Environment (build 1.6.0_02-b05)
Java HotSpot(TM) Client VM (build 1.6.0_02-b05, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
 customer  Windows XP [Version 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
JTree isExpanded(TreePath) is unnecessarily recursive. With the default stack size (or any reasonable size) a TreePath to a few thousand entries will lead to StackOverflowException. Trees are used to represent graphs, e.g., reference chains that can easily exceed this depth. isExpanded(TreePath) can be trivially rewritten as a loop.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
In a loop, lengthen a path by adding children to a branch of a tree, one per level, and keep calling isVisible() on the TreePath that represents the deepest child until you get StackOverflowException.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Some degradation in speed, but no exceptions.
ACTUAL -
StackOverflowException when isVisible(TreePath) calls isExpanded(TreePath).

REPRODUCIBILITY :
This bug can be reproduced always.
Posted Date : 2008-04-04 12:17:26.0
Work Around
N/A
Evaluation
Assigned to JTree owner
Posted Date : 2008-04-10 16:44:36.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang