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
* to record the object/description associations which are when stored
	 * in the Tree associated with the viewer.
	 */
	private Map contributionMemory;
	
	private ILabelProvider labelProvider;
	private final VisibilityAssistant assistant;
	private NavigatorFilterService navigatorFilterService;
	private INavigatorSorterService navigatorSorterService;
	private INavigatorPipelineService navigatorPipelineService;
	private INavigatorDnDService navigatorDnDService;
	private INavigatorActivationService navigatorActivationService;
	private NavigatorSaveablesService navigatorSaveablesService;
	private NavigatorExtensionStateService navigatorExtensionStateService;
	private IDescriptionProvider descriptionProvider;
	private boolean contentProviderInitialized;
	private boolean labelProviderInitialized;
	/**
	 * @param aViewerId
	 *            The viewer id for this content service; normally from the
	 *            <b>org.eclipse.ui.views</b> extension.
	 */
	public NavigatorContentService(String aViewerId) {
		super();
		aViewerId = aViewerId != null ? aViewerId : ""; 
		viewerDescriptor = VIEWER_DESCRIPTOR_REGISTRY
				.getNavigatorViewerDescriptor(aViewerId);
		assistant = new VisibilityAssistant(viewerDescriptor,
				getActivationService());
		getActivationService().addExtensionActivationListener(this);