Use Objects.equals()

This commit is contained in:
Gary Gregory 2023-07-16 16:26:59 -04:00
parent 308896c651
commit 53bb929c8f

View File

@ -114,7 +114,7 @@ public DiffBuilder(final T lhs, final T rhs,
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 DiffBuilder<T> append(final String fieldName, final Object lhs,
} }
// Not array type // Not array type
if (lhs != null && lhs.equals(rhs)) { if (Objects.equals(lhs, rhs)) {
return this; return this;
} }