This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git


The following commit(s) were added to refs/heads/master by this push:
     new d05073e  Delegate to Objects.equals().
d05073e is described below

commit d05073e66df710b8ac7186e59ebaa481eec006da
Author: Gary Gregory <[email protected]>
AuthorDate: Tue Aug 24 11:50:50 2021 -0400

    Delegate to Objects.equals().
---
 src/main/java/org/apache/commons/lang3/ObjectUtils.java | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/main/java/org/apache/commons/lang3/ObjectUtils.java 
b/src/main/java/org/apache/commons/lang3/ObjectUtils.java
index 22d8bc5..51d3428 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);
     }
 
     /**

Reply via email to