This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 179435 - Removing and adding children using outline fails to display properly
Summary: Removing and adding children using outline fails to display properly
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Outline&TreeTable (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P2 normal with 1 vote (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-12 12:15 UTC by KevinLemay
Modified: 2011-11-16 16:40 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description KevinLemay 2010-01-12 12:15:51 UTC
We have been using the Netbeans outline jar in our application. It was originally built on Netbeans 6.1 (platform9) and worked beautifully. 

We had a memory leak in a swing jar file and moved from platform9 to platform11 (v6.8). The memory leak is gone, but now I have display issues in our tree objects under certain conditions. 

When the table is empty and the objects are added, everything works as expected, but when I remove the lowest level child row (3 levels) and then re-add it later, the parent row shows the "key" icon showing that it has children, but it does not expand. Clicking on the "key" does nothing. However, if I collapse the grandparent in the tree and re-expand, it displays again. 

The child row added may be identical to the row hat was removed, but plenty of time has passed (5 seconds), everything should have been cleaned up. 

This bug has been duplicated using the TestOutlineDynamic code that I found on the netbeans site. Simply add a child, remove it and then re-add. If you create a three level tree such as ours, collapsing and expanding the grandparent node corrects the display.

I have verified that: 
platform9 - Everything works 
Platform10 - Has the issue described 
Platform11 - has the issue described
Comment 1 Martin Entlicher 2010-01-15 04:42:48 UTC
I've reproduced the problem by TestOutlineDynamic.
Comment 2 Martin Entlicher 2010-01-15 04:50:39 UTC
The problem is that TreePathSupport thinks that the path is already expanded, but it isn't. The bug seems to be in that when a child node is added again, the parent stays collapsed.
Comment 3 Martin Entlicher 2010-01-15 06:41:42 UTC
Suggesting as a patch candidate, the fix is not hard.
Unfortunately the parent node is collapsed by FixedHeightLayoutCache when the child is removed.

Fixed in changeset:   157329:5329b63a56e5
http://hg.netbeans.org/main/rev/5329b63a56e5
Comment 4 Quality Engineering 2010-01-16 00:22:16 UTC
Integrated into 'main-golden', will be available in build *201001160201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/5329b63a56e5
User: mentlicher@netbeans.org
Log: #179435 - Always retrieve the expanded state from layout. Caching of expandedPaths left only for the purpose of getExpandedDescendants().
Comment 5 ksingh 2010-06-16 22:33:57 UTC
I rebuilt the application that Kevin Lemay reported, using NetBeans 6.9, but I still see the problem.  Was this patch included in NB 6.9?  

Kamaljit Singh