void () { if (!isExpanded && getBuilder().isAlwaysShowPlus(descriptor)) { result.set(new Pair<>(true, null)); return; } Object element = getElementFor(node); if (element == null) { trace("null element for node " + node); result.set(new Pair<>(true, null)); return; } addToUpdatingChildren(node); try { LoadedChildren children = loadedChildren != null ? loadedChildren : new LoadedChildren(getChildrenFor(element)); boolean processed; if (children.getElements().isEmpty()) { removeFromUnbuilt(node); removeLoading(node, true); processed = true; } else { if (isAutoExpand(node)) { addNodeAction(getElementFor(node), false, node1 -> { TreePath path = new TreePath(node1.getPath()); if (getTree().isExpanded(path) || children.getElements().isEmpty()) { removeLoading(node1, false); } else { maybeYield(() -> { expand(element, null); return Promises.resolvedPromise(); }, pass, node1); } }); } processed = false; } removeFromUpdatingChildren(node); processNodeActionsIfReady(node); result.set(new Pair<>(processed, children)); } finally { removeFromUpdatingChildren(node); } }