You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by bo...@apache.org on 2016/03/23 16:32:25 UTC
[3/6] commons-compress git commit: use Objects.equals
use Objects.equals
Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/29377a32
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/29377a32
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/29377a32
Branch: refs/heads/compress-2.0
Commit: 29377a32c9110982217b3b1f3875bfff5b5e2639
Parents: 7ced707
Author: Stefan Bodewig <bo...@apache.org>
Authored: Wed Mar 23 15:34:45 2016 +0100
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Wed Mar 23 15:34:45 2016 +0100
----------------------------------------------------------------------
.../commons/compress2/archivers/OwnerInformation.java | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-compress/blob/29377a32/src/main/java/org/apache/commons/compress2/archivers/OwnerInformation.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress2/archivers/OwnerInformation.java b/src/main/java/org/apache/commons/compress2/archivers/OwnerInformation.java
index e9ec7ca..0203b07 100644
--- a/src/main/java/org/apache/commons/compress2/archivers/OwnerInformation.java
+++ b/src/main/java/org/apache/commons/compress2/archivers/OwnerInformation.java
@@ -18,6 +18,8 @@
*/
package org.apache.commons.compress2.archivers;
+import java.util.Objects;
+
/**
* Encapsulates owner information of an archive entry.
*
@@ -100,11 +102,8 @@ public class OwnerInformation {
OwnerInformation other = (OwnerInformation) obj;
return userId == other.userId
&& groupId == other.groupId
- && equals(userName, other.userName)
- && equals(groupName, other.groupName);
+ && Objects.equals(userName, other.userName)
+ && Objects.equals(groupName, other.groupName);
}
- private static boolean equals(Object o1, Object o2) {
- return o1 == null ? o2 == null : o1.equals(o2);
- }
}