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 c7ab53f  Simplify null checks in Triple.hashCode() using 
Objects.hashCode(). (#516)
c7ab53f is described below

commit c7ab53f9e34be876309e835f981db69920f79cdc
Author: Isira Seneviratne <31027858+isira-senevira...@users.noreply.github.com>
AuthorDate: Mon Apr 20 20:43:46 2020 +0000

    Simplify null checks in Triple.hashCode() using Objects.hashCode(). (#516)
---
 src/main/java/org/apache/commons/lang3/tuple/Triple.java | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/commons/lang3/tuple/Triple.java 
b/src/main/java/org/apache/commons/lang3/tuple/Triple.java
index c52fd67..e44dbc2 100644
--- a/src/main/java/org/apache/commons/lang3/tuple/Triple.java
+++ b/src/main/java/org/apache/commons/lang3/tuple/Triple.java
@@ -171,9 +171,7 @@ public abstract class Triple<L, M, R> implements 
Comparable<Triple<L, M, R>>, Se
      */
     @Override
     public int hashCode() {
-        return (getLeft() == null ? 0 : getLeft().hashCode()) ^
-            (getMiddle() == null ? 0 : getMiddle().hashCode()) ^
-            (getRight() == null ? 0 : getRight().hashCode());
+        return Objects.hashCode(getLeft()) ^ Objects.hashCode(getMiddle()) ^ 
Objects.hashCode(getRight());
     }
 
     /**

Reply via email to