Menu

#18 ConcurrentModificationException while zooming

0.9.6-beta
closed-fixed
None (23)
5
2010-09-14
2008-08-14
jfirechief
No

DO NOT EDIT OR ANSWER THIS ISSUE. SEE THE ORIGINAL ISSUE INSTEAD:
https://www.jfire.org/modules/bugs/view.php?id=884
ORIGINAL REPORTER: marco

Based on the screen shot that was part of the error report, I assume that this happened either when starting CrossTicket or when minimizing it (no window was visible on the screen shot).

java.util.ConcurrentModificationException
at java.util.AbstractList$Itr.checkForComodification(Unknown Source)
at java.util.AbstractList$Itr.next(Unknown Source)
at org.nightlabs.editor2d.viewer.ui.ZoomSupport.fireZoomChanged(ZoomSupport.java:91)
at org.nightlabs.editor2d.viewer.ui.ZoomSupport.setZoom(ZoomSupport.java:120)
at org.nightlabs.editor2d.viewer.ui.ZoomSupport.zoomAll(ZoomSupport.java:316)
at org.nightlabs.editor2d.viewer.ui.ZoomSupport.doZoomAll(ZoomSupport.java:322)
at org.nightlabs.editor2d.viewer.ui.ZoomSupport$2.propertyChange(ZoomSupport.java:340)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at java.awt.Component.firePropertyChange(Unknown Source)
at javax.swing.JComponent.removeNotify(Unknown Source)
at java.awt.Container.removeNotify(Unknown Source)
at java.awt.Window.removeNotify(Unknown Source)
at java.awt.Frame.removeNotify(Unknown Source)
at java.awt.Window$1DisposeAction.run(Unknown Source)
at java.awt.Window.doDispose(Unknown Source)
at java.awt.Window.dispose(Unknown Source)
at org.eclipse.swt.awt.SWT_AWT$5.run(SWT_AWT.java:218)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Discussion

  • jfirechief

    jfirechief - 2008-08-14
    • labels: --> None
    • milestone: --> 0.9.6-beta
    • assigned_to: nobody --> nlmarco
    • status: open --> open-fixed
     
  • jfirechief

    jfirechief - 2008-08-14

    Logged In: YES
    user_id=1828570
    Originator: YES

    ORIGINAL COMMENT BY marco, VIEW IT HERE:
    https://www.jfire.org/modules/bugs/view.php?id=884

    The code in question used a java.util.ArrayList. I switched to an org.eclipse.core.runtime.ListenerList, which is more efficient and easier to use correctly.

    Important note to everyone: Whenever you use a java.util.Collection to manage listeners, you MUST copy them when firing an event. Otherwise a listener which adds or removes listeners (itself or others) will likely cause a ConcurrentModificationException. Since copying is unnecessarily expensive and should be managed intelligently (e.g. by using a 2nd [unmodifiable] Collection), an Eclipse ListenerList is the better choice.

     
  • jfirechief

    jfirechief - 2010-09-14
    • status: open-fixed --> closed-fixed
     
  • jfirechief

    jfirechief - 2010-09-14

    ORIGINAL COMMENT BY marco, VIEW IT HERE:
    https://www.jfire.org/modules/bugs/view.php?id=884

    The code in question used a java.util.ArrayList. I switched to an org.eclipse.core.runtime.ListenerList, which is more efficient and easier to use correctly.

    Important note to everyone: Whenever you use a java.util.Collection to manage listeners, you MUST copy them when firing an event. Otherwise a listener which adds or removes listeners (itself or others) will likely cause a ConcurrentModificationException. Since copying is unnecessarily expensive and should be managed intelligently (e.g. by using a 2nd [unmodifiable] Collection), an Eclipse ListenerList is the better choice.

     

Log in to post a comment.

MongoDB Logo MongoDB