diff options
author | Oleg Besedin | 2012-04-27 14:30:40 +0000 |
---|---|---|
committer | Oleg Besedin | 2012-04-27 14:30:56 +0000 |
commit | b5bbb5ebdec5295187718a43e1de06dd5d5e547a (patch) | |
tree | 9426d6da9ec020298149d968f37e2be1504809a8 | |
parent | 7c2867ee59df24decbc94431e38f10b76507b4e3 (diff) | |
download | rt.equinox.bundles-I20120429-1800.tar.gz rt.equinox.bundles-I20120429-1800.tar.xz rt.equinox.bundles-I20120429-1800.zip |
Bug 309792 - [registry] resetting Target Platform -v20120427-1430I20120430-1300I20120429-2000I20120429-1800I20120429-1245I20120429-1000
ConcurrentModificationException and ArrayIndexOutOfBoundsException
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 9a17ed1ae..d044ebe07 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 c88fba694..552d42a5c 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) |