Project: Eclipse_Platform_UI
Bug 118107 [DynamicUI] [WorkingSets] WorkingSetDescriptor (org.eclipse.ui.internal.registry) caches IConfigurationElement causing intermittent crash
Reported: 2005-11-25 15:57:10 | Status: verified fixed

The IConfigurationElement should not be cached. Here are the comments from its Javadoc: These registry objects are intended for relatively short-term use. Clients that deal with these objects must be aware that they may become invalid if the declaring plug-in is updated or uninstalled. If this happens, all methods except {@link #isValid()} will throw {@link InvalidRegistryObjectException}. The org.eclipse.ui.internal.registry.WorkingSetDescriptor from org.eclipse.ui.workbench stores the IConfigurationElement in its member variable. Consider using: PlatformUI.getWorkbench().getExtensionTracker() org.eclipse.core.runtime.dynamichelpers.ExtensionTracker The current implementations will lead to intermittent crashes as found by Olivier Thomann: !ENTRY org.eclipse.osgi 2005-11-23 21:37:52.303 !MESSAGE An unexpected runtime error has occurred. !STACK 0 org.eclipse.core.runtime.InvalidRegistryObjectException: Invalid registry object at org.eclipse.core.internal.registry.RegistryObjectManager.basicGetObject(RegistryObjectManager.java:195) at org.eclipse.core.internal.registry.RegistryObjectManager.getObject(RegistryObjectManager.java:185) at org.eclipse.core.internal.registry.ConfigurationElementHandle.getConfigurationElement(ConfigurationElementHandle.java:28) at org.eclipse.core.internal.registry.ConfigurationElementHandle.getNamespace(ConfigurationElementHandle.java:114) at org.eclipse.core.internal.registry.eclipse.EclipseConfigurationElementHandle.getNamespace(EclipseConfigurationElementHandle.java:101) at org.eclipse.ui.internal.registry.WorkingSetDescriptor.getDeclaringNamespace(WorkingSetDescriptor.java:87) at org.eclipse.ui.internal.registry.WorkingSetRegistry.getDescriptorsForNamespace(WorkingSetRegistry.java:124) at org.eclipse.ui.internal.AbstractWorkingSetManager.bundleChanged(AbstractWorkingSetManager.java:544) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:1205) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:189) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:291) !ENTRY update@plugins/org.eclipse.ui.workbench_3.2.0.I20051122-1300.jar 0 0 2005-11-23 21:37:52.343 !MESSAGE FrameworkEvent.ERROR !STACK 0 org.eclipse.core.runtime.InvalidRegistryObjectException: Invalid registry object at org.eclipse.core.internal.registry.RegistryObjectManager.basicGetObject(RegistryObjectManager.java:195) at org.eclipse.core.internal.registry.RegistryObjectManager.getObject(RegistryObjectManager.java:185) at org.eclipse.core.internal.registry.ConfigurationElementHandle.getConfigurationElement(ConfigurationElementHandle.java:28) at org.eclipse.core.internal.registry.ConfigurationElementHandle.getNamespace(ConfigurationElementHandle.java:114) at org.eclipse.core.internal.registry.eclipse.EclipseConfigurationElementHandle.getNamespace(EclipseConfigurationElementHandle.java:101) at org.eclipse.ui.internal.registry.WorkingSetDescriptor.getDeclaringNamespace(WorkingSetDescriptor.java:87) at org.eclipse.ui.internal.registry.WorkingSetRegistry.getDescriptorsForNamespace(WorkingSetRegistry.java:124) at org.eclipse.ui.internal.AbstractWorkingSetManager.bundleChanged(AbstractWorkingSetManager.java:544) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:1205) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:189) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:291)

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ExtensionEventHandler.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkingSet.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/WorkingSetDescriptor.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/WorkingSetRegistry.java tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/DynamicPluginsTestSuite.java tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/WorkingSetTests.java