Author: vyemialyanchyk
Date: 2009-10-30 09:21:33 -0400 (Fri, 30 Oct 2009)
New Revision: 18367
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/ElementsFactory.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4956 - fix JUnit tests
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/ElementsFactory.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/ElementsFactory.java 2009-10-30
12:59:48 UTC (rev 18366)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/ElementsFactory.java 2009-10-30
13:21:33 UTC (rev 18367)
@@ -55,7 +55,9 @@
@SuppressWarnings("unchecked")
public void createForeingKeyConnections() {
- Iterator<OrmShape> it = elements.values().iterator();
+ // do clone cause elements could be changed during iteration!
+ HashMap<String, OrmShape> elementsTmp = (HashMap<String,
OrmShape>)elements.clone();
+ Iterator<OrmShape> it = elementsTmp.values().iterator();
while (it.hasNext()) {
final OrmShape shape = it.next();
Object ormElement = shape.getOrmElement();