Bug 273752 syncExec in org.eclipse.ui.internal.navigator.NavigatorContentService.getSourceOfContribution(Object) causes deadlock in test suite
The Platform UI test suite does not complete anymore - it hangs in the org.eclipse.ui.tests.dynamicplugins.EditorTests.testEditorClosure() test case. The hang is in the following code: final boolean[] flag = new boolean[] { false }; FrameworkListener listener = new FrameworkListener() { public void frameworkEvent(FrameworkEvent event) { if (event.getType() == FrameworkEvent.PACKAGES_REFRESHED) synchronized (flag) { flag[0] = true; flag.notifyAll(); } } }; context.addFrameworkListener(listener); packageAdmin.refreshPackages(bundles); synchronized (flag) { while (!flag[0]) { try { flag.wait(); } catch (InterruptedException e) { } } } The flag[0] is never set to true, which probably means that the PACKAGES_REFRESHED event is not fired.
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorContentService.java
IMementoAware, INavigatorContentService {
	/**
	 * 
	 */
	public static final String WIDGET_KEY = "org.eclipse.ui.navigator"; 
	
	private static final NavigatorContentDescriptorManager CONTENT_DESCRIPTOR_REGISTRY = NavigatorContentDescriptorManager
			.getInstance();
	private static final NavigatorViewerDescriptorManager VIEWER_DESCRIPTOR_REGISTRY = NavigatorViewerDescriptorManager
			.getInstance();
	private static final ITreeContentProvider[] NO_CONTENT_PROVIDERS = new ITreeContentProvider[0];
	private static final ILabelProvider[] NO_LABEL_PROVIDERS = new ILabelProvider[0];
	private static final INavigatorContentDescriptor[] NO_DESCRIPTORS = new INavigatorContentDescriptor[0];
	private static final String[] NO_EXTENSION_IDS = new String[0];
	private final NavigatorViewerDescriptor viewerDescriptor;
	private final List listeners = new ArrayList();
	/*
	 * A map of (String-based-Navigator-Content-Extension-IDs,
	 * NavigatorContentExtension-objects)-pairs
	 */
	private final Map contentExtensions = new HashMap();
	private StructuredViewerManager structuredViewerManager;
	private ITreeContentProvider[] rootContentProviders;
	private ITreeContentProvider contentProvider;
	/*
	 * Used when providing objects to the CommonViewer by the contentProvider