void (@NotNull DefaultMutableTreeNode node, @NotNull List<? extends TreeNode> children, boolean updateStamp, boolean forceSort) { NodeDescriptor<?> descriptor = getDescriptorFrom(node); assert descriptor != null; if (descriptor.getChildrenSortingStamp() >= getComparatorStamp() && !forceSort) return; if (!children.isEmpty()) { try { getBuilder().sortChildren(myNodeComparator, node, children); } catch (IllegalArgumentException exception) { StringBuilder sb = new StringBuilder("cannot sort children in ").append(this); children.forEach(child -> sb.append('\n').append(child)); throw new IllegalArgumentException(sb.toString(), exception); } } if (updateStamp) { descriptor.setChildrenSortingStamp(getComparatorStamp()); } }