Skip to content

Commit 39ca7ff

Browse files
committed
1 parent bd9434d commit 39ca7ff

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/difflib/algorithm/jgit/JGitDiff.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import difflib.patch.DeltaType;
2222
import java.util.ArrayList;
2323
import java.util.List;
24+
import java.util.Objects;
2425
import org.eclipse.jgit.diff.Edit;
2526
import org.eclipse.jgit.diff.EditList;
2627
import org.eclipse.jgit.diff.HistogramDiff;
@@ -37,6 +38,8 @@ public class JGitDiff<T> implements DiffAlgorithm<T> {
3738

3839
@Override
3940
public List<Change> diff(List<T> original, List<T> revised) throws DiffException {
41+
Objects.requireNonNull(original, "original list must not be null");
42+
Objects.requireNonNull(revised, "revised list must not be null");
4043
EditList diffList = new EditList();
4144
diffList.addAll(new HistogramDiff().diff(new DataListComparator<>(), new DataList<>(original), new DataList<>(revised)));
4245
List<Change> patch = new ArrayList<>();

0 commit comments

Comments
 (0)