[501145] ArrayIndexOutOfBoundsException in ResourceIsLoadingAdapter.getAdapter
diff --git a/plugins/org.eclipse.wst.common.emf/META-INF/MANIFEST.MF b/plugins/org.eclipse.wst.common.emf/META-INF/MANIFEST.MF index c4114ac..ab40677 100644 --- a/plugins/org.eclipse.wst.common.emf/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.wst.common.emf/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.wst.common.emf; singleton:=true -Bundle-Version: 1.2.400.qualifier +Bundle-Version: 1.2.500.qualifier Bundle-Activator: org.eclipse.wst.common.internal.emf.plugin.EcoreUtilitiesPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.wst.common.emf/pom.xml b/plugins/org.eclipse.wst.common.emf/pom.xml index 4070812..000f792 100644 --- a/plugins/org.eclipse.wst.common.emf/pom.xml +++ b/plugins/org.eclipse.wst.common.emf/pom.xml
@@ -22,6 +22,6 @@ <groupId>org.eclipse.webtools.common</groupId> <artifactId>org.eclipse.wst.common.emf</artifactId> - <version>1.2.400-SNAPSHOT</version> + <version>1.2.500-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> </project>
diff --git a/plugins/org.eclipse.wst.common.emf/wtpemf/org/eclipse/wst/common/internal/emf/utilities/ResourceIsLoadingAdapter.java b/plugins/org.eclipse.wst.common.emf/wtpemf/org/eclipse/wst/common/internal/emf/utilities/ResourceIsLoadingAdapter.java index a5d96ea..5f7edc8 100644 --- a/plugins/org.eclipse.wst.common.emf/wtpemf/org/eclipse/wst/common/internal/emf/utilities/ResourceIsLoadingAdapter.java +++ b/plugins/org.eclipse.wst.common.emf/wtpemf/org/eclipse/wst/common/internal/emf/utilities/ResourceIsLoadingAdapter.java
@@ -13,11 +13,13 @@ */ package org.eclipse.wst.common.internal.emf.utilities; +import java.util.ArrayList; import java.util.List; import org.eclipse.emf.common.notify.Adapter; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.impl.AdapterImpl; +import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.resource.Resource; /** @@ -40,8 +42,10 @@ * removeIsLoadingSupport() will coordinate with this * synchronization. */ - synchronized(aResource.eAdapters()) { - adapter = (ResourceIsLoadingAdapter) getAdapter(aResource.eAdapters(), ResourceIsLoadingAdapter.class); + EList<Adapter> resourceAdapters = aResource.eAdapters(); + synchronized(resourceAdapters) { + ArrayList<Adapter> resourceAdaptersCopy = new ArrayList<Adapter>(resourceAdapters); + adapter = (ResourceIsLoadingAdapter) getAdapter(resourceAdaptersCopy, ResourceIsLoadingAdapter.class); } return adapter;