aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Besedin2012-04-27 10:30:40 (EDT)
committerOleg Besedin2012-04-27 10:30:56 (EDT)
commitb5bbb5ebdec5295187718a43e1de06dd5d5e547a (patch)
tree9426d6da9ec020298149d968f37e2be1504809a8
parent7c2867ee59df24decbc94431e38f10b76507b4e3 (diff)
downloadrt.equinox.bundles-b5bbb5ebdec5295187718a43e1de06dd5d5e547a.zip
rt.equinox.bundles-b5bbb5ebdec5295187718a43e1de06dd5d5e547a.tar.gz
rt.equinox.bundles-b5bbb5ebdec5295187718a43e1de06dd5d5e547a.tar.bz2
ConcurrentModificationException and ArrayIndexOutOfBoundsException
-rw-r--r--bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionRegistry.java5
-rw-r--r--bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryObjectManager.java8
2 files changed, 9 insertions, 4 deletions
diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionRegistry.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionRegistry.java
index 9a17ed1..d044ebe 100644
--- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionRegistry.java
+++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionRegistry.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -1355,8 +1355,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR
public IContributor[] getAllContributors() {
access.enterRead();
try {
- Collection contributors = registryObjects.getContributors().values();
- return (IContributor[]) contributors.toArray(new IContributor[contributors.size()]);
+ return registryObjects.getContributorsSync();
} finally {
access.exitRead();
}
diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryObjectManager.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryObjectManager.java
index c88fba6..552d42a 100644
--- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryObjectManager.java
+++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryObjectManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,6 +12,7 @@ package org.eclipse.core.internal.registry;
import java.lang.ref.SoftReference;
import java.util.*;
+import org.eclipse.core.runtime.IContributor;
import org.eclipse.core.runtime.InvalidRegistryObjectException;
import org.eclipse.core.runtime.spi.RegistryContributor;
@@ -584,6 +585,11 @@ public class RegistryObjectManager implements IObjectManager {
return contributors;
}
+ synchronized IContributor[] getContributorsSync() {
+ Collection contributorValues = getContributors().values();
+ return (IContributor[]) contributorValues.toArray(new IContributor[contributorValues.size()]);
+ }
+
synchronized RegistryContributor getContributor(String id) {
RegistryContributor contributor = (RegistryContributor) getContributors().get(id);
if (contributor != null)