protected final List<GTreeNode> children() {
		synchronized (this) {
			if (isLoaded()) {
				return children;
			}
		}

		// The generateChildren must be called outside the synchronized scope because
		// if it is slow it will lock out other threads. Keep in mind that if this is
		// called outside the swing thread then this doesn't return
		// until the work is completed (even for slow loading nodes - they only offload
		// the children loading in another task if called on the swing thread)
		List<GTreeNode> newChildren = generateChildren();

		synchronized (this) {
			// null implies cancelled
			if (newChildren == null) {
				return Collections.emptyList();
			}

			// This can be tricky. If we are in the swing thread and the generate children
			// is deferred to a background thread and we are about to set an in-progress node,
			// then it is possible that the background thread got here first and we are about
			// to overwrite the actual children with an in-progress node. Check for that case.
			if (isInProgress(newChildren) && children != null) {
				return children;
			}

			doSetChildren(newChildren);

			return children;
		}
	}
Sets the parent of this node.  This method should only be used by a parent
node when a new child is added to that parent node.
@param parent the node that this node is being added to.
Ghidra/Framework/Docking/src/main/java/docking/widgets/tree/CoreGTreeNode.java