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

Bug 362212

Summary: [Viewers] ILazyTreeContentProvider: new elements remain uninitialized when child count increases
Product: [Eclipse Project] Platform Reporter: Missing name <harely>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: pwebster
Version: 4.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug
Attachments:
Description Flags
Code reproducing the problem.
none
screenshot none

Description Missing name CLA 2011-10-27 11:41:09 EDT
Build Identifier: 20110301-1815

When an ILazyTreeContentProvider reports an increased number of children from updateChildCount(Object,int) in response to a viewer refresh, the new items sometimes remain uninitialized: 
 - The label provider is not called to retrieve their labels.
 - If using an OwnerDrawLabelProvider, its paint(..) method is called with element==null
 - The items are drawn as empty

Calling TreeViewer.refresh() a second time seems to solve the problem.

Reproducible: Always

Steps to Reproduce:
1. Run the attached code
2. Click the button until the problem appears. The problem occurs on most, but not all, click. However it seems to follow a consistent pattern depending on the number of children - in the attached code it occurs consistently on the second click.
3. Uncommenting the second call to refresh() fixes the problem.
Comment 1 Missing name CLA 2011-10-27 11:47:44 EDT
Created attachment 206079 [details]
Code reproducing the problem.
Comment 2 Missing name CLA 2011-10-27 11:50:00 EDT
Created attachment 206080 [details]
screenshot
Comment 3 Lars Vogel CLA 2019-11-14 03:45:29 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.