void (DTree tree, List<? super DirDiffElementImpl> elements) { if (!myUpdating.get()) return; boolean separatorAdded = tree.getParent() == null; text.set(prepareText(tree.getPath())); for (DTree child : tree.getChildren()) { if (!myUpdating.get()) return; if (!child.isContainer()) { if (child.isVisible()) { if (!separatorAdded) { elements.add(DirDiffElementImpl.createDirElement(tree, tree.getSource(), tree.getTarget(), tree.getPath())); separatorAdded = true; } final DiffType type = child.getType(); if (type != null) { switch (type) { case SOURCE: elements.add(DirDiffElementImpl.createSourceOnly(child, child.getSource())); break; case TARGET: elements.add(DirDiffElementImpl.createTargetOnly(child, child.getTarget())); break; case CHANGED: elements.add(DirDiffElementImpl.createChange(child, child.getSource(), child.getTarget(), mySettings.customSourceChooser)); break; case EQUAL: elements.add(DirDiffElementImpl.createEqual(child, child.getSource(), child.getTarget())); break; case ERROR: elements.add(DirDiffElementImpl.createError(child, child.getSource(), child.getTarget())); case SEPARATOR: break; } } else { LOG.error(String.format("Element's type is null [Name: %s, Container: %s, Source: %s, Target: %s] ", child.getName(), child.isContainer(), child.getSource(), child.getTarget())); } } } else { fillElements(child, elements); } } }