HierarchyNodeDescriptor (Project project, PsiMethod method) { List<PsiClass> superClasses = buildSuperChain(method); PsiClass containingClass = method.getContainingClass(); assert containingClass != null; HierarchyNodeDescriptor descriptor = null; for (PsiClass superClass : superClasses) { HierarchyNodeDescriptor newDescriptor = new MethodHierarchyNodeDescriptor(project, descriptor, superClass, false, this); if (descriptor != null) { descriptor.setCachedChildren(new HierarchyNodeDescriptor[]{newDescriptor}); } descriptor = newDescriptor; } HierarchyNodeDescriptor newDescriptor = new MethodHierarchyNodeDescriptor(project, descriptor, containingClass, true, this); if (descriptor != null) { descriptor.setCachedChildren(new HierarchyNodeDescriptor[] {newDescriptor}); } return newDescriptor; }