Example #1
0
 @NotNull
 protected Object[] trimStrings(@NotNull DiffString[] strings) {
   Object[] result = new Object[strings.length];
   for (int i = 0; i < strings.length; i++) {
     DiffString string = strings[i];
     result[i] = string.trim();
   }
   return result;
 }
Example #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);
 }