Bug 5820 Close all editors brings up hierarchy of object
Build: 1107 1. Open a Java editor in the Java perspective 2. Select the project 3. Hit Ctrl-Shift-F4 The hierarchy for Object appears after ~30 seconds. This is very confusing.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
}
		if (fInputElement == null) {
			
			return;
		}
		
		IJavaElement elem= (IJavaElement)editor.getEditorInput().getAdapter(IJavaElement.class);
		try {
			TypeHierarchyViewer currentViewer= getCurrentViewer();
			if (elem instanceof IClassFile) {
				IType type= ((IClassFile)elem).getType();
				if (currentViewer.isElementShown(type)) {
					currentViewer.setSelection(new StructuredSelection(type));
				}
			} else if (elem instanceof ICompilationUnit) {
				IType[] allTypes= ((ICompilationUnit)elem).getAllTypes();
				for (int i= 0; i < allTypes.length; i++) {
					if (currentViewer.isElementShown(allTypes[i])) {
						currentViewer.setSelection(new StructuredSelection(allTypes[i]));
						return;
					}
				}
			}	
		} catch (JavaModelException e) {
			JavaPlugin.log(e.getStatus());
		}
		
	}	
	
}