DirDiffElementImpl (DTree parent, @NotNull DiffElement source, @NotNull DiffElement target, @Nullable DirDiffSettings.CustomSourceChooser customSourceChooser) { DirDiffOperation defaultOperation = null; if (customSourceChooser != null) { DiffElement chosenSource = customSourceChooser.chooseSource(source, target); if (chosenSource == source) { // chosenSource might be null defaultOperation = COPY_TO; } else if (chosenSource == target) { defaultOperation = COPY_FROM; } } return new DirDiffElementImpl(parent, source, target, DiffType.CHANGED, source.getPresentableName(), defaultOperation); }