Bug 46351 Call Hierarchy must not implement IViewSite [call hierarchy]
I20031105 The call hierarchy component implements IViewSite which is not allowed. There seems to be no reason for doing so: the CallHierarchyViewPart should directly set the selection provider to its site.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/callhierarchy/OpenCallHierarchyAction.java
for (int i= 0; i < elements.length; i++) {
            IJavaElement[] resolvedElements= CallHierarchyUI.getCandidates(elements[i]);
            if (resolvedElements != null)   
                candidates.addAll(Arrays.asList(resolvedElements));
        }
        if (candidates.isEmpty()) {
            IJavaElement enclosingMethod= getEnclosingMethod(input, selection);
            if (enclosingMethod != null) {
                candidates.add(enclosingMethod);
            }
        }
        run((IJavaElement[])candidates.toArray(new IJavaElement[candidates.size()]));
    }
    
    private IJavaElement getEnclosingMethod(IJavaElement input, ITextSelection selection) {
        IJavaElement enclosingElement= null;
        try {
            switch (input.getElementType()) {
                case IJavaElement.CLASS_FILE :
                    IClassFile classFile= (IClassFile) input.getAncestor(IJavaElement.CLASS_FILE);
                    if (classFile != null) {
                        enclosingElement= classFile.getElementAt(selection.getOffset());
                    }
                    break;
                case IJavaElement.COMPILATION_UNIT :
                    ICompilationUnit cu= (ICompilationUnit) input.getAncestor(IJavaElement.COMPILATION_UNIT);
                    if (cu != null) {
                        enclosingElement= cu.getElementAt(selection.getOffset());
                    }
                    break;