diff --git a/src/main/java/org/apache/commons/lang3/ObjectUtils.java b/src/main/java/org/apache/commons/lang3/ObjectUtils.java index 22d8bc5f3..51d3428dd 100644 --- a/src/main/java/org/apache/commons/lang3/ObjectUtils.java +++ b/src/main/java/org/apache/commons/lang3/ObjectUtils.java @@ -625,13 +625,7 @@ public class ObjectUtils { */ @Deprecated public static boolean equals(final Object object1, final Object object2) { - if (object1 == object2) { - return true; - } - if (object1 == null || object2 == null) { - return false; - } - return object1.equals(object2); + return Objects.equals(object1, object2); } /** @@ -1184,7 +1178,7 @@ public class ObjectUtils { * @return {@code false} if the values of both objects are the same */ public static boolean notEqual(final Object object1, final Object object2) { - return !equals(object1, object2); + return !Objects.equals(object1, object2); } /**