ConcurrentModificationException

Hi Beni,

My soft is roughtly this,
I have a tree on the left and a CControl on the right with different CDockable …
When i clic on an item on my tree the CControl associated with the item is loaded (xml) and the CControl associated with the previous item is saved.
When i’m saying saved and load i’m taking about the layout.

Sometimes i’ve got Exception below and do not realy indurstand what’s happening.

Exception in thread "AWT-EventQueue-0" java.util.ConcurrentModificationException
	at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
	at java.util.AbstractList$Itr.next(AbstractList.java:343)
	at bibliothek.gui.dock.themes.basic.action.buttons.ButtonPanel.getPreferredSize(ButtonPanel.java:413)
	at bibliothek.gui.dock.title.AbstractDockTitle.getPreferredSize(AbstractDockTitle.java:792)
	at bibliothek.gui.dock.themes.basic.BasicDockableDisplayer.doLayout(BasicDockableDisplayer.java:556)
	at bibliothek.gui.dock.themes.basic.BasicDockableDisplayer$3.doLayout(BasicDockableDisplayer.java:151)
	at java.awt.Container.validateTree(Container.java:1507)
	at java.awt.Container.validateTree(Container.java:1513)
	at java.awt.Container.validateTree(Container.java:1513)
	at java.awt.Container.validateTree(Container.java:1513)
	at java.awt.Container.validateTree(Container.java:1513)
	at java.awt.Container.validateTree(Container.java:1513)
	at java.awt.Container.validateTree(Container.java:1513)
	at java.awt.Container.validateTree(Container.java:1513)
	at java.awt.Container.validateTree(Container.java:1513)
	at java.awt.Container.validate(Container.java:1480)
	at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:669)
	at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:124)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:641)
	at java.awt.EventQueue.access$000(EventQueue.java:84)
	at java.awt.EventQueue$1.run(EventQueue.java:602)
	at java.awt.EventQueue$1.run(EventQueue.java:600)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:611)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Since an exception like this should have shown up a long time ago, I guess your application is part of the issue. My best guess: your application is using multi-threading. Loading or storing the layout must be done from the EventDispatchThread, actually every access to DockingFrames should be done from the EDT.

Thanks Beni,

I’m doing the call throught the EDT now and il looks like it partly solved the problem.
But i’m still having closing/resizing/docking button disaparing without any Exception.

Are you perhaps showing CDockables that are no longer connect to a CControl? I would need a little bit more information to help…

Hi Beni,

it looks like the problem is solved. I was doing setVisible and remove on my CDockable.
If i play with it meaning load save load save … it doas work.
Then i close my soft and when i open it windows are added and it looks like it doesn’t respect the loaded file.

Hi Beni,

as usual nothing wrong with the lib …
When i create a new CDockable i give it the id “ID”+System.CurrentMillisecond()

In my DockableFactory i was doing the same :o)
So now it does work fine.

Thanks for your time and for the lib.

:slight_smile: