void (TreePath path, int oldRowCount) { if (path == null || oldRowCount + 1 != getRowCount()) return; JTree tree = getTree(); if (!shouldAutoExpand(tree, path)) return; TreeModel model = tree.getModel(); if (model instanceof AsyncTreeModel && 1 == model.getChildCount(path.getLastPathComponent())) { int pathCount = 1 + path.getPathCount(); for (int i = 0; i <= oldRowCount; i++) { TreePath row = getPathForRow(i); if (row != null && pathCount == row.getPathCount() && path.equals(row.getParentPath())) { handleAutoExpand(row); // this code is intended to auto-expand a single child node return; } } } }