diff options
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) |