Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2008-04-09 15:27:14 -0400
committerkmoore2008-04-09 15:27:14 -0400
commita563a51b500e98dfc92ff70445e7a9f486fa7bd7 (patch)
tree545ce3a86e5f86f00d01ee5a6a67523fca52312e
parent828b50f87e48b255fd70ae3d541f9a2228e2279f (diff)
downloadwebtools.dali-a563a51b500e98dfc92ff70445e7a9f486fa7bd7.tar.gz
webtools.dali-a563a51b500e98dfc92ff70445e7a9f486fa7bd7.tar.xz
webtools.dali-a563a51b500e98dfc92ff70445e7a9f486fa7bd7.zip
prevent ConcurrentModificationExceptions during update from xml resource model
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmQuery.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmSingleRelationshipMapping.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericEntityMappings.java15
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmAssociationOverride.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEntity.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinTable.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentType.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmSecondaryTable.java2
9 files changed, 32 insertions, 30 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java
index 0c7133576e..d28332e445 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java
@@ -187,7 +187,7 @@ public abstract class AbstractOrmBaseEmbeddedMapping<T extends BaseXmlEmbedded>
protected void updateSpecifiedAttributeOverrides(T embedded) {
ListIterator<OrmAttributeOverride> attributeOverrides = specifiedAttributeOverrides();
- ListIterator<XmlAttributeOverride> resourceAttributeOverrides = embedded.getAttributeOverrides().listIterator();
+ ListIterator<XmlAttributeOverride> resourceAttributeOverrides = new CloneListIterator<XmlAttributeOverride>(embedded.getAttributeOverrides());//prevent ConcurrentModificiationException
while (attributeOverrides.hasNext()) {
OrmAttributeOverride attributeOverride = attributeOverrides.next();
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmQuery.java
index 22943ff091..c1ed3cd15e 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmQuery.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmQuery.java
@@ -137,7 +137,7 @@ public abstract class AbstractOrmQuery<E extends XmlQuery> extends AbstractOrmJp
protected void updateHints(E queryResource) {
ListIterator<OrmQueryHint> hints = hints();
- ListIterator<XmlQueryHint> resourceHints = queryResource.getHints().listIterator();
+ ListIterator<XmlQueryHint> resourceHints = new CloneListIterator<XmlQueryHint>(queryResource.getHints());//prevent ConcurrentModificiationException
while (hints.hasNext()) {
OrmQueryHint hint = hints.next();
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmSingleRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmSingleRelationshipMapping.java
index b3a0597c92..0cd4256638 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmSingleRelationshipMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmSingleRelationshipMapping.java
@@ -235,7 +235,7 @@ public abstract class AbstractOrmSingleRelationshipMapping<T extends XmlSingleRe
ListIterator<OrmJoinColumn> joinColumns = specifiedJoinColumns();
ListIterator<XmlJoinColumn> resourceJoinColumns = EmptyListIterator.instance();
if (singleRelationshipMapping != null) {
- resourceJoinColumns = singleRelationshipMapping.getJoinColumns().listIterator();
+ resourceJoinColumns = new CloneListIterator<XmlJoinColumn>(singleRelationshipMapping.getJoinColumns());//prevent ConcurrentModificiationException
}
while (joinColumns.hasNext()) {
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericEntityMappings.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericEntityMappings.java
index be3c8af29d..f28964524e 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericEntityMappings.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericEntityMappings.java
@@ -10,6 +10,7 @@
package org.eclipse.jpt.core.internal.context.orm;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
@@ -581,7 +582,7 @@ public class GenericEntityMappings extends AbstractOrmJpaContextNode implements
}
protected void updateMappedSuperclasses(XmlEntityMappings entityMappings, ListIterator<OrmPersistentType> ormPersistentTypes) {
- for (XmlMappedSuperclass mappedSuperclass : entityMappings.getMappedSuperclasses()) {
+ for (XmlMappedSuperclass mappedSuperclass : Collections.unmodifiableCollection(entityMappings.getMappedSuperclasses())) {//prevent ConcurrentModificiationException
if (ormPersistentTypes.hasNext()) {
ormPersistentTypes.next().update(mappedSuperclass);
}
@@ -594,7 +595,7 @@ public class GenericEntityMappings extends AbstractOrmJpaContextNode implements
}
protected void updateEntities(XmlEntityMappings entityMappings, ListIterator<OrmPersistentType> ormPersistentTypes) {
- for (XmlEntity entity : entityMappings.getEntities()) {
+ for (XmlEntity entity : Collections.unmodifiableCollection(entityMappings.getEntities())) {//prevent ConcurrentModificiationException
if (ormPersistentTypes.hasNext()) {
ormPersistentTypes.next().update(entity);
}
@@ -607,7 +608,7 @@ public class GenericEntityMappings extends AbstractOrmJpaContextNode implements
}
protected void updateEmbeddables(XmlEntityMappings entityMappings, ListIterator<OrmPersistentType> ormPersistentTypes) {
- for (XmlEmbeddable embeddable : entityMappings.getEmbeddables()) {
+ for (XmlEmbeddable embeddable : Collections.unmodifiableCollection(entityMappings.getEmbeddables())) {//prevent ConcurrentModificiationException
if (ormPersistentTypes.hasNext()) {
ormPersistentTypes.next().update(embeddable);
}
@@ -621,7 +622,7 @@ public class GenericEntityMappings extends AbstractOrmJpaContextNode implements
protected void updateTableGenerators(XmlEntityMappings entityMappings) {
ListIterator<OrmTableGenerator> tableGenerators = tableGenerators();
- ListIterator<XmlTableGenerator> resourceTableGenerators = entityMappings.getTableGenerators().listIterator();
+ ListIterator<XmlTableGenerator> resourceTableGenerators = new CloneListIterator<XmlTableGenerator>(entityMappings.getTableGenerators());//prevent ConcurrentModificiationException
while (tableGenerators.hasNext()) {
OrmTableGenerator tableGenerator = tableGenerators.next();
if (resourceTableGenerators.hasNext()) {
@@ -645,7 +646,7 @@ public class GenericEntityMappings extends AbstractOrmJpaContextNode implements
protected void updateSequenceGenerators(XmlEntityMappings entityMappings) {
ListIterator<OrmSequenceGenerator> sequenceGenerators = sequenceGenerators();
- ListIterator<XmlSequenceGenerator> resourceSequenceGenerators = entityMappings.getSequenceGenerators().listIterator();
+ ListIterator<XmlSequenceGenerator> resourceSequenceGenerators = new CloneListIterator<XmlSequenceGenerator>(entityMappings.getSequenceGenerators());//prevent ConcurrentModificiationException
while (sequenceGenerators.hasNext()) {
OrmSequenceGenerator sequenceGenerator = sequenceGenerators.next();
if (resourceSequenceGenerators.hasNext()) {
@@ -669,7 +670,7 @@ public class GenericEntityMappings extends AbstractOrmJpaContextNode implements
protected void updateNamedQueries(XmlEntityMappings entityMappings) {
ListIterator<OrmNamedQuery> namedQueries = namedQueries();
- ListIterator<XmlNamedQuery> resourceNamedQueries = entityMappings.getNamedQueries().listIterator();
+ ListIterator<XmlNamedQuery> resourceNamedQueries = new CloneListIterator<XmlNamedQuery>(entityMappings.getNamedQueries());//prevent ConcurrentModificiationException
while (namedQueries.hasNext()) {
OrmNamedQuery namedQuery = namedQueries.next();
@@ -694,7 +695,7 @@ public class GenericEntityMappings extends AbstractOrmJpaContextNode implements
protected void updateNamedNativeQueries(XmlEntityMappings entityMappings) {
ListIterator<OrmNamedNativeQuery> namedNativeQueries = namedNativeQueries();
- ListIterator<XmlNamedNativeQuery> resourceNamedNativeQueries = entityMappings.getNamedNativeQueries().listIterator();
+ ListIterator<XmlNamedNativeQuery> resourceNamedNativeQueries = new CloneListIterator<XmlNamedNativeQuery>(entityMappings.getNamedNativeQueries());//prevent ConcurrentModificiationException
while (namedNativeQueries.hasNext()) {
OrmNamedNativeQuery namedQuery = namedNativeQueries.next();
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmAssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmAssociationOverride.java
index 007fecd520..92f2999299 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmAssociationOverride.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmAssociationOverride.java
@@ -156,7 +156,7 @@ public class GenericOrmAssociationOverride extends AbstractOrmJpaContextNode
protected void updateSpecifiedJoinColumns(XmlAssociationOverride associationOverride) {
ListIterator<OrmJoinColumn> joinColumns = specifiedJoinColumns();
- ListIterator<XmlJoinColumn> resourceJoinColumns = associationOverride.getJoinColumns().listIterator();
+ ListIterator<XmlJoinColumn> resourceJoinColumns = new CloneListIterator<XmlJoinColumn>(associationOverride.getJoinColumns());//prevent ConcurrentModificiationException
while (joinColumns.hasNext()) {
OrmJoinColumn joinColumn = joinColumns.next();
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEntity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEntity.java
index 4cf7ebfaaa..a58765e987 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEntity.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEntity.java
@@ -1243,7 +1243,7 @@ public class GenericOrmEntity extends AbstractOrmTypeMapping<XmlEntity> implemen
protected void updateSpecifiedSecondaryTables(XmlEntity entity) {
ListIterator<OrmSecondaryTable> secondaryTables = specifiedSecondaryTables();
- ListIterator<XmlSecondaryTable> resourceSecondaryTables = entity.getSecondaryTables().listIterator();
+ ListIterator<XmlSecondaryTable> resourceSecondaryTables = new CloneListIterator<XmlSecondaryTable>(entity.getSecondaryTables());//prevent ConcurrentModificiationException
while (secondaryTables.hasNext()) {
OrmSecondaryTable secondaryTable = secondaryTables.next();
@@ -1346,7 +1346,7 @@ public class GenericOrmEntity extends AbstractOrmTypeMapping<XmlEntity> implemen
protected void updateSpecifiedPrimaryKeyJoinColumns(XmlEntity entity) {
ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns = specifiedPrimaryKeyJoinColumns();
- ListIterator<XmlPrimaryKeyJoinColumn> resourcePrimaryKeyJoinColumns = entity.getPrimaryKeyJoinColumns().listIterator();
+ ListIterator<XmlPrimaryKeyJoinColumn> resourcePrimaryKeyJoinColumns = new CloneListIterator<XmlPrimaryKeyJoinColumn>(entity.getPrimaryKeyJoinColumns());//prevent ConcurrentModificiationException
while (primaryKeyJoinColumns.hasNext()) {
OrmPrimaryKeyJoinColumn primaryKeyJoinColumn = primaryKeyJoinColumns.next();
@@ -1371,7 +1371,7 @@ public class GenericOrmEntity extends AbstractOrmTypeMapping<XmlEntity> implemen
protected void updateSpecifiedAttributeOverrides(XmlEntity entity) {
ListIterator<OrmAttributeOverride> attributeOverrides = specifiedAttributeOverrides();
- ListIterator<XmlAttributeOverride> resourceAttributeOverrides = entity.getAttributeOverrides().listIterator();
+ ListIterator<XmlAttributeOverride> resourceAttributeOverrides = new CloneListIterator<XmlAttributeOverride>(entity.getAttributeOverrides());//prevent ConcurrentModificiationException
while (attributeOverrides.hasNext()) {
OrmAttributeOverride attributeOverride = attributeOverrides.next();
@@ -1398,7 +1398,7 @@ public class GenericOrmEntity extends AbstractOrmTypeMapping<XmlEntity> implemen
protected void updateSpecifiedAssociationOverrides(XmlEntity entity) {
ListIterator<OrmAssociationOverride> associationOverrides = specifiedAssociationOverrides();
- ListIterator<XmlAssociationOverride> resourceAssociationOverrides = entity.getAssociationOverrides().listIterator();
+ ListIterator<XmlAssociationOverride> resourceAssociationOverrides = new CloneListIterator<XmlAssociationOverride>(entity.getAssociationOverrides());//prevent ConcurrentModificiationException
while (associationOverrides.hasNext()) {
OrmAssociationOverride associationOverride = associationOverrides.next();
@@ -1425,7 +1425,7 @@ public class GenericOrmEntity extends AbstractOrmTypeMapping<XmlEntity> implemen
protected void updateNamedQueries(XmlEntity entity) {
ListIterator<OrmNamedQuery> namedQueries = namedQueries();
- ListIterator<XmlNamedQuery> resourceNamedQueries = entity.getNamedQueries().listIterator();
+ ListIterator<XmlNamedQuery> resourceNamedQueries = new CloneListIterator<XmlNamedQuery>(entity.getNamedQueries());//prevent ConcurrentModificiationException
while (namedQueries.hasNext()) {
OrmNamedQuery namedQuery = namedQueries.next();
@@ -1450,7 +1450,7 @@ public class GenericOrmEntity extends AbstractOrmTypeMapping<XmlEntity> implemen
protected void updateNamedNativeQueries(XmlEntity entity) {
ListIterator<OrmNamedNativeQuery> namedNativeQueries = namedNativeQueries();
- ListIterator<XmlNamedNativeQuery> resourceNamedNativeQueries = entity.getNamedNativeQueries().listIterator();
+ ListIterator<XmlNamedNativeQuery> resourceNamedNativeQueries = new CloneListIterator<XmlNamedNativeQuery>(entity.getNamedNativeQueries());//prevent ConcurrentModificiationException
while (namedNativeQueries.hasNext()) {
OrmNamedNativeQuery namedQuery = namedNativeQueries.next();
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinTable.java
index daea446578..03e0a0a091 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinTable.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinTable.java
@@ -372,7 +372,7 @@ public class GenericOrmJoinTable extends AbstractOrmTable implements OrmJoinTabl
ListIterator<OrmJoinColumn> joinColumns = specifiedJoinColumns();
ListIterator<XmlJoinColumn> resourceJoinColumns = EmptyListIterator.instance();
if (joinTable != null) {
- resourceJoinColumns = joinTable.getJoinColumns().listIterator();
+ resourceJoinColumns = new CloneListIterator<XmlJoinColumn>(joinTable.getJoinColumns());//prevent ConcurrentModificiationException
}
while (joinColumns.hasNext()) {
@@ -411,7 +411,7 @@ public class GenericOrmJoinTable extends AbstractOrmTable implements OrmJoinTabl
ListIterator<OrmJoinColumn> inverseJoinColumns = specifiedInverseJoinColumns();
ListIterator<XmlJoinColumn> resourceInverseJoinColumns = EmptyListIterator.instance();
if (joinTable != null) {
- resourceInverseJoinColumns = joinTable.getInverseJoinColumns().listIterator();
+ resourceInverseJoinColumns = new CloneListIterator<XmlJoinColumn>(joinTable.getInverseJoinColumns());//prevent ConcurrentModificiationException
}
while (inverseJoinColumns.hasNext()) {
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentType.java
index d1f6230c95..61a7aabca7 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentType.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentType.java
@@ -11,6 +11,7 @@ package org.eclipse.jpt.core.internal.context.orm;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
@@ -669,7 +670,7 @@ public class GenericOrmPersistentType extends AbstractOrmJpaContextNode implemen
}
protected void updateIds(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) {
- for (XmlId id : attributes.getIds()) {
+ for (XmlId id : Collections.unmodifiableCollection(attributes.getIds())) {//prevent ConcurrentModificiationException
if (ormPersistentAttributes.hasNext()) {
ormPersistentAttributes.next().update(id);
}
@@ -682,7 +683,7 @@ public class GenericOrmPersistentType extends AbstractOrmJpaContextNode implemen
}
protected void updateEmbeddedIds(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) {
- for (XmlEmbeddedId embeddedId : attributes.getEmbeddedIds()) {
+ for (XmlEmbeddedId embeddedId : Collections.unmodifiableCollection(attributes.getEmbeddedIds())) {//prevent ConcurrentModificiationException
if (ormPersistentAttributes.hasNext()) {
ormPersistentAttributes.next().update(embeddedId);
}
@@ -695,7 +696,7 @@ public class GenericOrmPersistentType extends AbstractOrmJpaContextNode implemen
}
protected void updateBasics(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) {
- for (XmlBasic basic : attributes.getBasics()) {
+ for (XmlBasic basic : Collections.unmodifiableCollection(attributes.getBasics())) {//prevent ConcurrentModificiationException
if (ormPersistentAttributes.hasNext()) {
ormPersistentAttributes.next().update(basic);
}
@@ -708,7 +709,7 @@ public class GenericOrmPersistentType extends AbstractOrmJpaContextNode implemen
}
protected void updateVersions(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) {
- for (XmlVersion version : attributes.getVersions()) {
+ for (XmlVersion version : Collections.unmodifiableCollection(attributes.getVersions())) {//prevent ConcurrentModificiationException
if (ormPersistentAttributes.hasNext()) {
ormPersistentAttributes.next().update(version);
}
@@ -720,7 +721,7 @@ public class GenericOrmPersistentType extends AbstractOrmJpaContextNode implemen
}
}
protected void updateManyToOnes(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) {
- for (XmlManyToOne manyToOne : attributes.getManyToOnes()) {
+ for (XmlManyToOne manyToOne : Collections.unmodifiableCollection(attributes.getManyToOnes())) {//prevent ConcurrentModificiationException
if (ormPersistentAttributes.hasNext()) {
ormPersistentAttributes.next().update(manyToOne);
}
@@ -732,7 +733,7 @@ public class GenericOrmPersistentType extends AbstractOrmJpaContextNode implemen
}
}
protected void updateOneToManys(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) {
- for (XmlOneToMany oneToMany : attributes.getOneToManys()) {
+ for (XmlOneToMany oneToMany : Collections.unmodifiableCollection(attributes.getOneToManys())) {//prevent ConcurrentModificiationException
if (ormPersistentAttributes.hasNext()) {
ormPersistentAttributes.next().update(oneToMany);
}
@@ -744,7 +745,7 @@ public class GenericOrmPersistentType extends AbstractOrmJpaContextNode implemen
}
}
protected void updateOneToOnes(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) {
- for (XmlOneToOne oneToOne : attributes.getOneToOnes()) {
+ for (XmlOneToOne oneToOne : Collections.unmodifiableCollection(attributes.getOneToOnes())) {//prevent ConcurrentModificiationException
if (ormPersistentAttributes.hasNext()) {
ormPersistentAttributes.next().update(oneToOne);
}
@@ -756,7 +757,7 @@ public class GenericOrmPersistentType extends AbstractOrmJpaContextNode implemen
}
}
protected void updateManyToManys(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) {
- for (XmlManyToMany manyToMany : attributes.getManyToManys()) {
+ for (XmlManyToMany manyToMany : Collections.unmodifiableCollection(attributes.getManyToManys())) {//prevent ConcurrentModificiationException
if (ormPersistentAttributes.hasNext()) {
ormPersistentAttributes.next().update(manyToMany);
}
@@ -769,7 +770,7 @@ public class GenericOrmPersistentType extends AbstractOrmJpaContextNode implemen
}
protected void updateEmbeddeds(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) {
- for (XmlEmbedded embedded : attributes.getEmbeddeds()) {
+ for (XmlEmbedded embedded : Collections.unmodifiableCollection(attributes.getEmbeddeds())) {//prevent ConcurrentModificiationException
if (ormPersistentAttributes.hasNext()) {
ormPersistentAttributes.next().update(embedded);
}
@@ -782,7 +783,7 @@ public class GenericOrmPersistentType extends AbstractOrmJpaContextNode implemen
}
protected void updateTransients(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) {
- for (XmlTransient transientResource : attributes.getTransients()) {
+ for (XmlTransient transientResource : Collections.unmodifiableCollection(attributes.getTransients())) {//prevent ConcurrentModificiationException
if (ormPersistentAttributes.hasNext()) {
ormPersistentAttributes.next().update(transientResource);
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmSecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmSecondaryTable.java
index 1759fa9e2c..8ccd9ff4e3 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmSecondaryTable.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmSecondaryTable.java
@@ -222,7 +222,7 @@ public class GenericOrmSecondaryTable extends AbstractOrmTable
protected void updateSpecifiedPrimaryKeyJoinColumns(XmlSecondaryTable secondaryTable) {
ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns = specifiedPrimaryKeyJoinColumns();
- ListIterator<XmlPrimaryKeyJoinColumn> resourcePrimaryKeyJoinColumns = secondaryTable.getPrimaryKeyJoinColumns().listIterator();
+ ListIterator<XmlPrimaryKeyJoinColumn> resourcePrimaryKeyJoinColumns = new CloneListIterator<XmlPrimaryKeyJoinColumn>(secondaryTable.getPrimaryKeyJoinColumns());//prevent ConcurrentModificiationException
while (primaryKeyJoinColumns.hasNext()) {
OrmPrimaryKeyJoinColumn primaryKeyJoinColumn = primaryKeyJoinColumns.next();

Back to the top