mirror of
https://github.com/java-diff-utils/java-diff-utils.git
synced 2026-03-13 10:11:17 +08:00
replaced some null checks
This commit is contained in:
@@ -59,15 +59,10 @@ public abstract class Delta<T> {
|
||||
* @param revised Chunk describing the revised text. Must not be {@code null}.
|
||||
*/
|
||||
public Delta(DeltaType deltaType, Chunk<T> original, Chunk<T> revised) {
|
||||
if (deltaType == null) {
|
||||
throw new IllegalArgumentException("deltaType must not be null");
|
||||
}
|
||||
if (original == null) {
|
||||
throw new IllegalArgumentException("original must not be null");
|
||||
}
|
||||
if (revised == null) {
|
||||
throw new IllegalArgumentException("revised must not be null");
|
||||
}
|
||||
Objects.requireNonNull(deltaType, "deltaType must not be null");
|
||||
Objects.requireNonNull(original, "original must not be null");
|
||||
Objects.requireNonNull(revised, "revised must not be null");
|
||||
|
||||
this.deltaType = deltaType;
|
||||
this.original = original;
|
||||
this.revised = revised;
|
||||
|
||||
@@ -33,5 +33,5 @@ public interface Equalizer<T> {
|
||||
* @param revised The revised element. Must not be {@code null}.
|
||||
* @return Returns true if the elements are equal.
|
||||
*/
|
||||
public boolean equals(T original, T revised);
|
||||
boolean equals(T original, T revised);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user