Ejemplo n.º 1
0
 @NotNull
 @Override
 public DiffFragment[] buildFragments(
     @NotNull DiffString[] strings1, @NotNull DiffString[] strings2)
     throws FilesTooBigForDiffException {
   DiffFragment[] fragments = super.buildFragments(strings1, strings2);
   DiffCorrection.FragmentsCollector collector = new DiffCorrection.FragmentsCollector();
   collector.processAll(fragments, this);
   return collector.toArray();
 }
Ejemplo n.º 2
0
 @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);
 }