From 4407bc6ba9b973811d2eafc7ce4f496fd8182f23 Mon Sep 17 00:00:00 2001 From: Gertjan van Oosten Date: Wed, 5 Aug 2020 10:04:38 +0200 Subject: [PATCH] NCI-Agency/anet#3124: Fix equals method --- src/main/java/mil/dds/anet/beans/Person.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/mil/dds/anet/beans/Person.java b/src/main/java/mil/dds/anet/beans/Person.java index 6c3c6d5561..22a0cc915d 100644 --- a/src/main/java/mil/dds/anet/beans/Person.java +++ b/src/main/java/mil/dds/anet/beans/Person.java @@ -314,12 +314,11 @@ public boolean equals(Object o) { && Objects.equals(other.getRank(), rank) && Objects.equals(other.getBiography(), biography) && Objects.equals(other.getPendingVerification(), pendingVerification) && Objects.equals(other.getAvatar(), getAvatar()) && Objects.equals(other.getCode(), code) - && (createdAt != null) - ? (createdAt.equals(other.getCreatedAt())) - : (other.getCreatedAt() == null) && (updatedAt != null) - ? (updatedAt.equals(other.getUpdatedAt())) - : (other.getUpdatedAt() == null) - && Objects.equals(other.getCustomFields(), customFields); + && (createdAt != null ? createdAt.equals(other.getCreatedAt()) + : (other.getCreatedAt() == null && updatedAt != null) + ? updatedAt.equals(other.getUpdatedAt()) + : other.getUpdatedAt() == null) + && Objects.equals(other.getCustomFields(), customFields); return b; }