@Override public void process( @NotNull DiffFragment fragment, @NotNull DiffCorrection.FragmentsCollector collector) { if (fragment.isEqual()) { collector.add(fragment); return; } if (fragment.isOneSide()) { FragmentSide side = FragmentSide.chooseSide(fragment); DiffString text = side.getText(fragment); DiffString trimed = text.trim(); if (trimed.isEmpty()) { collector.add(side.createFragment(text, DiffString.EMPTY, false)); return; } } collector.add(fragment); }
@Nullable private static DiffString toNull(@Nullable DiffString text1) { return text1 == null || text1.isEmpty() ? null : text1; }