|
|
Re: Problem with some event notification... [message #177088 is a reply to message #176835] |
Tue, 12 April 2005 19:26 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
> Wouldn't the iterator have the same problem? You can only invoke the
Right, you'd get a ConcurrentModificationException.
> iterator's remove method to guarantte anything.
>
> What do other frameworks do? I believe SWT loops through using an index
> as
> well. So does PropertyChangeSupport.
SWT leaves holes (null) in its arrays to prevent the index from getting off.
AWT uses a special binary tree. JFace and others use copy-on-modify.
I like AWT's implementation the best, but someone would have to re-implement
the datastructure in a clean-room style.
|
|
|
Re: Problem with some event notification... [message #177127 is a reply to message #176810] |
Tue, 12 April 2005 20:26 |
Eclipse User |
|
|
|
Originally posted by: christian.sell.netcologne.de
the iterator would only help if it was used to remove the current
element via iterator.remove().
Rudolf Hornig wrote:
> I don't have an account for bugzilla so i'm reporting it here. Would
> someone be so kind to put it in... Thanks.
>
> It seems that some fireXXX methods in GEF and Draw2D has some issue with
> sending out notification IF the notified object manipulates the listener
> list during a notification. For example as a response to an
> ancestorRemoved notification it tries to remove itself (or any other
> listener added before itself) from the ancestorListener list. This is
> caused because AncestorHelper.fireAncestorRemoved is iterating over the
> listener list using a for loop instead using an iterator. This causes
> that after it removed itself from the list, the next listener on the
> list will not be called by the fireAncestorRemoved action (as the whole
> array will be shifted down by one). Please check and change the
> implementation to use iterators.
>
> Affected classes with similar problems:
> Draw2d: AncestorHelper, ButtonGroup, UpdateManager
> GEF: PaletteViewer, AbstractEditPartViwer
>
> Thanks, Rudolf
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03276 seconds