Bug 40830 hierarchy view not up to date after rename [type hierarchy]
If you use the standard java perspective layout and have the following file --------------------------------A.java------------------------ public class A { } class B extends A { } -------------------------------------------------------------- double click on the first 'A' and press F4 (hierarchy view) then click on the package explorer (so as to hide the hierarchy view). then rename the class A to class C (using refactoring) double click on the new class name and click F4 the hierarchy still displays with 'A' at the root and not the new name ('C')
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/OpenTypeHierarchyUtil.java
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.ui.actions.OpenActionUtil;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyViewPart;
public class OpenTypeHierarchyUtil {
	
	private OpenTypeHierarchyUtil() {
	}
	public static TypeHierarchyViewPart open(IJavaElement element, IWorkbenchWindow window) {
		IJavaElement[] candidates= getCandidates(element);
		if (candidates != null) {
			return open(candidates, window);
		}
		return null;
	}	
	
	public static TypeHierarchyViewPart open(IJavaElement[] candidates, IWorkbenchWindow window) {
		Assert.isTrue(candidates != null && candidates.length != 0);
			
		IJavaElement input= null;
		if (candidates.length > 1) {
			String title= JavaUIMessages.getString("OpenTypeHierarchyUtil.selectionDialog.title");  
			String message= JavaUIMessages.getString("OpenTypeHierarchyUtil.selectionDialog.message"); 
			input= OpenActionUtil.selectJavaElement(candidates, window.getShell(), title, message);			
		} else {
			input= candidates[0];
		}
		if (input == null)