NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug.

The Fiji project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Bug 113 - Deleting all patches from a project throws an exception
Deleting all patches from a project throws an exception
Status: RESOLVED FIXED
Product: Fiji
Classification: Unclassified
Component: TrakEM2
unspecified
PC Linux
: P2 normal
Assigned To: Albert Cardona
Depends on:
Blocks:
 
Reported: 2009-12-03 17:34 CST by Stephan Saalfeld
Modified: 2009-12-03 18:31 CST
0 users

See Also:

Description Stephan Saalfeld 2009-12-03 17:34:45 CST
Import a lot of patches, then select all and delete them.  The following exception is thrown:

==================
ERROR:
java.util.ConcurrentModificationException
	at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
	at java.util.AbstractList$Itr.next(AbstractList.java:343)
	at ini.trakem2.display.Layer.find(Layer.java:519)
	at ini.trakem2.display.DisplayCanvas$OffscreenThread.paint(DisplayCanvas.java:2131)
	at ini.trakem2.display.AbstractOffscreenThread.run(AbstractOffscreenThread.java:53)
==================
Comment 1 Albert Cardona 2009-12-03 18:15:05 CST
After programming so much in clojure, I see java code as so brittle regarding concurrency as to be almost naive.

I know why this harmless exception happens. I can try to design a remove-en-block that will avoid it.

The Layer and LayerSet are not thread safe.
Comment 2 Albert Cardona 2009-12-03 18:31:55 CST
Quick fix committed.
Proper fix will have to wait; a redesign of Layer and LayerSet to make them proper persistent containers is on order.