summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Hauge2013-07-16 11:36:40 (EDT)
committer John Arthorne2013-10-09 15:54:52 (EDT)
commit4f198697c419eb625fd3f2d04f66e91b989228ab (patch)
tree256e54f523bfd42985d53a0e264445edba068783
parente587fafa548fdd0b5478593503c35805ec6a62c2 (diff)
downloadrt.equinox.bundles-4f198697c419eb625fd3f2d04f66e91b989228ab.zip
rt.equinox.bundles-4f198697c419eb625fd3f2d04f66e91b989228ab.tar.gz
rt.equinox.bundles-4f198697c419eb625fd3f2d04f66e91b989228ab.tar.bz2
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.java11
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 0698277..bcee1f6 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;
}