You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2020/03/03 21:07:02 UTC

[GitHub] [accumulo] jmark99 commented on a change in pull request #1541: Replace use of equals() with Object.equals()

jmark99 commented on a change in pull request #1541: Replace use of equals() with Object.equals()
URL: https://github.com/apache/accumulo/pull/1541#discussion_r387293749
 
 

 ##########
 File path: core/src/main/java/org/apache/accumulo/core/client/admin/DiskUsage.java
 ##########
 @@ -47,9 +48,9 @@ public boolean equals(Object o) {
 
     DiskUsage diskUsage = (DiskUsage) o;
 
-    if (tables != null ? !tables.equals(diskUsage.tables) : diskUsage.tables != null)
+    if (!Objects.equals(tables, diskUsage.tables))
       return false;
-    return usage != null ? usage.equals(diskUsage.usage) : diskUsage.usage == null;
+    return Objects.equals(usage, diskUsage.usage);
 
 Review comment:
   Thanks @EdColeman . Updated to add further simplification and updated hashCode.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services