Reputation: 1307
We've found a ConcurrentModificationException exception in our GUI log which seems to be related to changing the list backing a table model.
The order seems to be:
Since they are both on the EDT, if I use synchronized keyword (or a lock), in both places, will event2 give up and let event1 processing continue, or will I have created a fancy deadlock?
Upvotes: 0
Views: 249
Reputation: 324207
seems to be related to changing the list backing a table model.
You should not be changing the List. All updates should be done directly on the model.
In many cases when you have a ConcurrentModificationExecption you can wrap that code in a SwingUtilities.invokeLater() so the code gets added to the end of the EDT allowing the first event to finish processing.
Upvotes: 2