Community
Participate
Working Groups
Build ID: M20090211-1700 Steps To Reproduce: Implement a subclass of AbstractObservable with Cloneable support. More information: The org.eclipse.core.databinding.observable.ChangeManager class doesn't implement a clone() method, making it impossible to implement a subclass of AbstractObservable with Cloneable support. If you attempt to clone an instance of ChangeManager, the clone will contain references to the same listenerLists and listenerTypes arrays as the original. Listeners previously added to the original ChangeManager will receive events from the clone, and attempts to add or remove listeners on the original or its clone will affect both objects. ChangeManager can support Cloneable by implementing a clone method that resets the array references in the clone. public void clone() throws CloneNotSupportedException { ChangeManager duplicate = (ChangeManager)super.clone(); duplicate.listenerLists = null; duplicate.listenerTypes = null; return duplicate; }
Boris, +1?
+1 (this is not an API change, right?)
(In reply to comment #2) > +1 (this is not an API change, right?) Correct. Although I wouldn't put it past API Tooling to flag it anyway :)
Created attachment 133392 [details] Patch
Released to HEAD > 20090427
Chris, would you download the patch and then attach it yourself to this bug? This way the IP log will show this contribution came from you.
Created attachment 134113 [details] Adds a clone method to ChangeManager Re-attaching the patch file as requested by Matthew Hall
Comment on attachment 134113 [details] Adds a clone method to ChangeManager thanks!
Removing iplog+ from bug - this indicates an IP contribution in a comment rather than a patch. http://wiki.eclipse.org/Development_Resources/Automatic_IP_Log