NodeInfo (XNamedTreeNode node) { String name = node.getName(); if (myChildren == null) { return null; } List<NodeInfo> infos = (List<NodeInfo>)myChildren.get(name); if (infos.size() > 1) { TreeNode parent = node.getParent(); if (parent instanceof XDebuggerTreeNode) { int idx = 0; for (XDebuggerTreeNode treeNode : ((XDebuggerTreeNode)parent).getLoadedChildren()) { if (treeNode == node) { break; } if (treeNode instanceof XNamedTreeNode && Objects.equals(((XNamedTreeNode)treeNode).getName(), name)) { idx++; } } if (idx < infos.size()) { return infos.get(idx); } } } return ContainerUtil.getFirstItem(infos); }