Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356707 - [Activities] Activity add/removes listener during notification which results in inconsistent behaviour
Summary: [Activities] Activity add/removes listener during notification which results ...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6.2   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-05 03:02 EDT by bugs CLA
Modified: 2019-11-14 03:24 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bugs CLA 2011-09-05 03:02:09 EDT
Build Identifier: 20110218-0911

org.eclipse.ui.internal.activities.Activity:

fireActivityChanged() operates directly on the listener list and not on a copy of it. Therefore if a listener is removed during the activityChange() subsequent listener are skipped.

I would suggest to make a temporary copy of the activityListener List and use it in the notification loop.

Reproducible: Always

Steps to Reproduce:
1. Add two IActivityListener to the same Activity (IActivity.addActivityListener)
2. Let the first listener remove itself from the activity when called by calling IActivity.removeActivityListener
3. Change the activity on which the two listener where added. Result: The first listener removes itself from IActivity and the second listener is not called.
Comment 1 Lars Vogel CLA 2019-11-14 03:24:03 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.