if (candidates.isEmpty()) { IJavaElement enclosingMethod= getEnclosingMethod(input, selection); if (enclosingMethod != null) { candidates.add(enclosingMethod); } }
    protected void run(ITextSelection selection) {        IJavaElement input= SelectionConverter.getInput(fEditor);        if (!ActionUtil.isProcessable(getShell(), input))            return;                     IJavaElement[] elements= SelectionConverter.codeResolveOrInputHandled(fEditor, getShell(), getDialogTitle());        if (elements == null)            return;        List candidates= new ArrayList(elements.length);        for (int i= 0; i < elements.length; i++) {            IJavaElement[] resolvedElements= CallHierarchyUI.getCandidates(elements[i]);            if (resolvedElements != null)                   candidates.addAll(Arrays.asList(resolvedElements));        }        run((IJavaElement[])candidates.toArray(new IJavaElement[candidates.size()]));    }