Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 226336 - [progress] DeferredTreeContentManager update listener misleading
Summary: [progress] DeferredTreeContentManager update listener misleading
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M2   Edit
Assignee: Prakash Rangaraj CLA
QA Contact: Prakash Rangaraj CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-09 14:15 EDT by Susan McCourt CLA
Modified: 2009-09-15 04:10 EDT (History)
4 users (show)

See Also:


Attachments
Patch v01 (3.71 KB, patch)
2009-08-31 13:08 EDT, Prakash Rangaraj CLA
no flags Details | Diff
patch v02 (3.93 KB, patch)
2009-09-09 12:41 EDT, Susan McCourt CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Susan McCourt CLA 2008-04-09 14:15:27 EDT
For 3.4, DeferredTreeContentManager introduces an addUpdateCompleteListener(...) method.  (per bug #215734).

However it is really operating as a setUpdateCompleteListener(...) method.  You can't add multiple listeners.  It will simply replace the listener each time.

I think it should be changed to add listeners to a listener list, although it's possible this could break clients who inadvertantly added the listener multiple times. 

I got bitten by this while trying to implement a strategy for knowing when a particular model element was done fetching.  I had hoped to use this listener for that purpose by adding one for each fetch, but of course this caused timing problems...only the most recently added listener was called regardless of which fetch had completed.
Comment 1 Susan McCourt CLA 2009-07-09 19:38:58 EDT
As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009
Comment 2 Prakash Rangaraj CLA 2009-07-10 05:05:50 EDT
Targetting for 3.6
Comment 3 Prakash Rangaraj CLA 2009-08-31 13:08:48 EDT
Created attachment 146086 [details]
Patch v01

Attaching patch.

Susan, 
    Do you have any comments on the patch?
Comment 4 Susan McCourt CLA 2009-09-09 12:41:55 EDT
Created attachment 146773 [details]
patch v02

Replacement patch
Comment 5 Susan McCourt CLA 2009-09-09 12:46:33 EDT
The patch looks good.  I attached a replacement patch to handle a couple of things:
- fleshed out the javadoc to describe the update job listener in a little more detail.  Also included the standard "has no effect" verbage for adding the same listener twice, removing a listener that was never added, etc.
- Since the removeUpdateListener is a new method for 3.6, I found it a bit odd that there was compatibility code in there.  Instead, I moved all the relevant checking into the addUpdateListener method, since that is the method whose semantics are changing.

p2 never used this listener because of the original problem.  This will allow us to consider using it again.

Since PDE requested this listener in the first place, I've cc'ed Curtis and Darin to comment on whether this change could break PDE in any way.  (Not sure if PDE still uses this or not since they have their own asynch viewer stuff).  We should make sure they are ok with it before it goes in (esp if it is to go into M2).
Comment 6 Prakash Rangaraj CLA 2009-09-10 04:11:33 EDT
Haven't seen any issues with PDE plugins view in my testing. Patch v02 released to HEAD
Comment 7 Prakash Rangaraj CLA 2009-09-15 04:10:17 EDT
Verified in I20090914-1800