Bug 309851 [CommonNavigator] Navigating to Project Explorer causes an NPE
Build Identifier: Eclipse 3.6, build I20100406-1034 If the object in Project Explorer's tree does not have associated IWorkbenchAdapter then navigating to Project Explorer causes an NPE. The regression was introduced in the "org.eclipse.ui.navigator.resources.ProjectExplorer" class. Private method "convertElement" attempts to get the IWorkbenchAdapter class from our object in the tree. It then blindly calls "getParent()" without checking if the adapter is returned first, which causes the NPE and breaks navigation. Please take a look at the line "found = wba.getParent(original);". private Object convertElement(Object original) { NavigatorContentService ncs = (NavigatorContentService) getNavigatorContentService(); Object found = ncs.getViewerElementData(original); if (found != null) return original; if (original instanceof IAdaptable) { IAdaptable adaptable = (IAdaptable) original; found = adaptable.getAdapter(IResource.class); if (found != null) return found; IWorkbenchAdapter wba = (IWorkbenchAdapter) adaptable.getAdapter(IWorkbenchAdapter.class); found = wba.getParent(original); if (found != null) return convertElement(found); } return original; } Marking as major because navigation is completely broken for us. Reproducible: Always Steps to Reproduce: 1. Please see the details section. 2. 3.
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/navigator/resources/ProjectExplorer.java
}
			}
			setContentDescription(input.toString());
			return;
		}
		IResource res = (IResource) input;
		setContentDescription(res.getName());
	}
	/**
	 * Returns the tool tip text for the given element.
	 * 
	 * @param element
	 *            the element
	 * @return the tooltip
	 * @noreference
	 */
	public String getFrameToolTipText(Object element) {
		String result;
		if (!(element instanceof IResource)) {
			if (element instanceof IAggregateWorkingSet) {
				result = WorkbenchNavigatorMessages.ProjectExplorerPart_workingSetModel;
			} else if (element instanceof IWorkingSet) {
				result = ((IWorkingSet) element).getLabel();
			} else {
				result = super.getFrameToolTipText(element);
			}
		} else {
			IPath path = ((IResource) element).getFullPath();
			if (path.isRoot()) {
				result = WorkbenchNavigatorMessages.ProjectExplorerPart_workspace;