Community
Participate
Working Groups
When using a Sirius modeler which uses A3/MTL expressions, if I refresh the diagram while the properties view (using the default EEF-based rules) is visible, I often get this stack trace: Caused by: java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextNode(HashMap.java:1442) at java.util.HashMap$EntryIterator.next(HashMap.java:1476) at java.util.HashMap$EntryIterator.next(HashMap.java:1474) at com.google.common.collect.AbstractMapBasedMultimap$AsMap$AsMapIterator.next(AbstractMapBasedMultimap.java:1428) at com.google.common.collect.AbstractMapBasedMultimap$AsMap$AsMapIterator.next(AbstractMapBasedMultimap.java:1417) at org.eclipse.sirius.common.acceleo.mtl.business.internal.interpreter.AcceleoMTLInterpreter.createCompilationContext(AcceleoMTLInterpreter.java:519) at org.eclipse.sirius.common.acceleo.mtl.business.internal.interpreter.AcceleoMTLInterpreter.internalEvaluate(AcceleoMTLInterpreter.java:1154) at org.eclipse.sirius.common.acceleo.mtl.business.internal.interpreter.AcceleoMTLInterpreter.evaluateString(AcceleoMTLInterpreter.java:701) at org.eclipse.sirius.tools.internal.interpreter.SessionInterpreter.evaluateString(SessionInterpreter.java:301) I'll complete with proper reproduction steps later, but my current analysis of what happens (to be confirmed): * the "Refresh" operation requested by the end-user is launched in a separate job, and thus run out of the UI thread; * while the refresh is executing in that thread, the UI thread continues processing UI events, and in particular at some point refreshes the properties view; * inside the UI thread (what's important is that it is a separate thread that the one executing the refresh, not that it is *the* UI thread), EEF uses the SessionInterpreter to evaluate expressions, which requires setting/unsetting variables; * because the modeler uses MTL expressions, the SessionInterpter has an instance of AcceleoMTLInterpreter instanciated, to which it forwards all requests to set/unset variables; * if these requests by EEF from the UI thread happen to overlap with the evaluation of MTL expressions from inside the refresh, and thus another thread, the way createCompilationContext accesses the "current variables" detects a concurrent change and throws the exception.