Use Objects.equals()

This commit is contained in:
Gary Gregory 2023-07-16 16:26:59 -04:00
parent 308896c651
commit 53bb929c8f
1 changed files with 2 additions and 2 deletions

View File

@ -114,7 +114,7 @@ public class DiffBuilder<T> implements Builder<DiffResult<T>> {
this.style = style; this.style = style;
// Don't compare any fields if objects equal // Don't compare any fields if objects equal
this.objectsTriviallyEqual = testTriviallyEqual && (lhs == rhs || lhs.equals(rhs)); this.objectsTriviallyEqual = testTriviallyEqual && Objects.equals(lhs, rhs);
} }
/** /**
@ -814,7 +814,7 @@ public class DiffBuilder<T> implements Builder<DiffResult<T>> {
} }
// Not array type // Not array type
if (lhs != null && lhs.equals(rhs)) { if (Objects.equals(lhs, rhs)) {
return this; return this;
} }