mannyzhou5 / evolutionchamber

Automatically exported from code.google.com/p/evolutionchamber
0 stars 0 forks source link

Error when stopping threads #134

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When you are working on a build order that is already satisfied and you press 
the Stop button, it throws an exception when stopping the threads, funny thing 
is the exception stops the threads :D, but you have to press the Stop button 
again to run the rest of the ActionPerformed function for that button (-> 
enabling start button again and disabling the stop button).
This is the exception console print:

Exception in thread "AWT-EventQueue-0" java.util.ConcurrentModificationException
    at java.util.AbstractList$Itr.checkForComodification(Unknown Source)
    at java.util.AbstractList$Itr.next(Unknown Source)
    at com.fray.evo.EvolutionChamber.stop(EvolutionChamber.java:115)
    at com.fray.evo.ui.swingx.EcSwingX$79.actionPerformed(EcSwingX.java:1519)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(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)

happens in the EvolutionChamber.stop() function somewhere.

Original issue reported on code.google.com by azzur...@gmail.com on 8 Nov 2010 at 11:11

GoogleCodeExporter commented 9 years ago
Oh forgot to add this is on revision 101

Original comment by azzur...@gmail.com on 8 Nov 2010 at 11:13

GoogleCodeExporter commented 9 years ago
oh ok it has to be this change (the addition of Thread.remove() in revision 99)

https://code.google.com/p/evolutionchamber/source/diff?spec=svn99&r=99&format=si
de&path=/trunk/EvolutionChamber/src/java/com/fray/evo/EvolutionChamber.java

Dunno what this does so somebody else please take a look at it ^^

Original comment by azzur...@gmail.com on 8 Nov 2010 at 11:17

GoogleCodeExporter commented 9 years ago
I don't understand the point of this code either. It does not appear to break 
anything when removed.

Original comment by AudioL...@gmail.com on 9 Nov 2010 at 1:13

GoogleCodeExporter commented 9 years ago
Neither do I.  The exception is thrown because it's trying to modify the 
threads list as it's iterating over it.  The threads list is cleared once all 
the threads have stopped, so I don't think the threads.remove() code is 
necessary.

Original comment by mike.angstadt on 10 Nov 2010 at 5:31

GoogleCodeExporter commented 9 years ago
It looks like Lomilar fixed this in in r117.  Closing.

Original comment by mike.angstadt on 24 Nov 2010 at 2:35