Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 309407

Summary: [Viewers] [viewers] #expandToLevel(Object, level) retrieves all children when virtual
Product: [Eclipse Project] Platform Reporter: Boris Bokowski <bokowski>
Component: UIAssignee: Boris Bokowski <bokowski>
Status: RESOLVED FIXED QA Contact: Hitesh <hsoliwal>
Severity: normal    
Priority: P3 CC: bokowski, daniel_megert, darin.eclipse, francisu, hsoliwal, ndsilva, pawel.1.piech, remy.suen
Version: 3.4.2Flags: darin.eclipse: review+
Target Milestone: 3.6 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 305739    
Bug Blocks: 304277, 309406    

Description Boris Bokowski CLA 2010-04-15 20:34:53 EDT
+++ This bug was initially created as a clone of Bug #305739 +++

3.4.2 (M20090211-1700)

Calling TreeViewer#expandToLevel(Object, level) when using a tree viewer with a lazy content provider and SWT.VIRTUAL style, causes all children to be retrived via org.eclipse.jface.viewers.ILazyTreePathContentProvider.updateElement(TreePath, int). 

I would expect that expanding an element in the tree would only trigger the retrieval of the visible elements, since the tree is virtual. This is noticeable in the debugger when there is a deep stack (say 400 frames). In this case the debugger calls back to replace each element in the tree (once for each child - 400 times in this case).

See related bug 304277, in debug.
Comment 1 Boris Bokowski CLA 2010-04-15 20:35:18 EDT
Fix needs to be applied to HEAD for 3.6.
Comment 2 Paul Webster CLA 2010-05-12 11:34:23 EDT
These bugs are now targetted at RC1.  They need to be fixed or deferred.

PW
Comment 3 Boris Bokowski CLA 2010-05-12 13:53:34 EDT
Paul, could you please review the patch from bug 305739 for inclusion in 3.6? The fix has been applied to 3.4+ and was tested and verified by a product team there.
Comment 4 Darin Wright CLA 2010-05-12 16:40:44 EDT
+1 to "proposed patch" on bug 305739.
Comment 5 Boris Bokowski CLA 2010-05-12 19:25:08 EDT
Released to HEAD.
Comment 6 Boris Bokowski CLA 2010-05-13 07:18:57 EDT
This fix caused a test failure on GTK. I believe this is a problem with the test, not the fix, but I would appreciate if you could test the Debug scenario on Linux GTK to be sure.

I've released a change to the test - calling processEvents() instead of Tree.update() - to HEAD.
Comment 7 Darin Wright CLA 2010-05-13 10:23:03 EDT
(In reply to comment #6)
> This fix caused a test failure on GTK. I believe this is a problem with the
> test, not the fix, but I would appreciate if you could test the Debug scenario
> on Linux GTK to be sure.

Tested on Linux, looks good.