void (DirDiffSettings settings) { for (DTree tree : getChildren()) { final DiffElement<?> src = tree.getSource(); final DiffElement<?> trg = tree.getTarget(); if (src instanceof DiffErrorElement || trg instanceof DiffErrorElement) { tree.setType(ERROR); } else if (src == null && trg != null) { tree.setType(DiffType.TARGET); } else if (src != null && trg == null) { tree.setType(DiffType.SOURCE); } else { assert src != null; Boolean equals = null; if (src instanceof ComparableDiffElement) equals = ((ComparableDiffElement)src).isContentEqual(trg); if (equals == null && trg instanceof ComparableDiffElement) equals = ((ComparableDiffElement)trg).isContentEqual(src); if (equals == null) { equals = switch (settings.compareMode) { case CONTENT -> isEqualContents(src, trg); case TEXT -> isEqualContentsAsText(src, trg); case SIZE -> isEqualSizes(src, trg); case TIMESTAMP -> isEqualTimestamps(src, trg, settings); }; } tree.setType(equals ? DiffType.EQUAL : DiffType.CHANGED); } tree.updateChildren(settings); } }