diff options
author | Neil Hauge | 2013-07-16 15:36:40 +0000 |
---|---|---|
committer | John Arthorne | 2013-07-16 15:41:23 +0000 |
commit | 003ae109666066cce1aa56c25b39b6edc162926a (patch) | |
tree | 935fab9c6d31ea07727378b5b2dcf1ea6c15282d | |
parent | 64b5654183f465e5ceb5b8fbf3cccd6727705735 (diff) | |
download | rt.equinox.bundles-003ae109666066cce1aa56c25b39b6edc162926a.tar.gz rt.equinox.bundles-003ae109666066cce1aa56c25b39b6edc162926a.tar.xz rt.equinox.bundles-003ae109666066cce1aa56c25b39b6edc162926a.zip |
Bug 408506 - PlatformObject.getAdapter(Class) can return null for valid
adapter due to race condition
Signed-off-by: Neil Hauge <neil.hauge@oracle.com>
-rw-r--r-- | bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/adapter/AdapterFactoryProxy.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/adapter/AdapterFactoryProxy.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/adapter/AdapterFactoryProxy.java index 06982776b..bcee1f667 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/adapter/AdapterFactoryProxy.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/adapter/AdapterFactoryProxy.java @@ -1,10 +1,12 @@ /******************************************************************************* - * Copyright (c) 2004, 2008 IBM Corporation and others. All rights reserved. + * Copyright (c) 2004, 2013 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 http://www.eclipse.org/legal/epl-v10.html * - * Contributors: IBM - Initial API and implementation + * Contributors: + * IBM - Initial API and implementation + * Oracle - Fix for bug 408506 ******************************************************************************/ package org.eclipse.core.internal.adapter; @@ -130,13 +132,14 @@ class AdapterFactoryProxy implements IAdapterFactory, IAdapterFactoryExt { } if (!force && !isActive) return null; - //set to true to prevent repeated attempts to load a broken factory - factoryLoaded = true; try { factory = (IAdapterFactory) element.createExecutableExtension("class"); //$NON-NLS-1$ } catch (CoreException e) { String msg = NLS.bind(RegistryMessages.adapters_cantInstansiate, getAdaptableType(), element.getContributor().getName()); RuntimeLog.log(new Status(IStatus.ERROR, RegistryMessages.OWNER_NAME, 0, msg, e)); + } finally { + //set to true to prevent repeated attempts to load a broken factory + factoryLoaded = true; } return factory; } |