private void expandDefaultChangeList(DefaultTreeModel oldModel, ChangesBrowserNode root) { if (((ChangesBrowserNode) oldModel.getRoot()).getCount() == 0 && TreeUtil.collectExpandedPaths(this).size() == 1) { TreeNode toExpand = null; for (int i = 0; i < root.getChildCount(); i++) { TreeNode node = root.getChildAt(i); if (node instanceof ChangesBrowserChangeListNode && node.getChildCount() > 0) { ChangeList object = ((ChangesBrowserChangeListNode) node).getUserObject(); if (object instanceof LocalChangeList) { if (((LocalChangeList) object).isDefault()) { toExpand = node; break; } } } } if (toExpand != null) { expandPath(new TreePath(new Object[] {root, toExpand})); } } }