From 44405325cf7e824b360719b098f754d674306de0 Mon Sep 17 00:00:00 2001 From: David Kocher Date: Tue, 10 Oct 2023 15:30:04 +0200 Subject: [PATCH] Make verdict part of hash code. --- core/src/main/java/ch/cyberduck/core/PathAttributes.java | 5 +++++ core/src/test/java/ch/cyberduck/core/PathAttributesTest.java | 3 +++ 2 files changed, 8 insertions(+) diff --git a/core/src/main/java/ch/cyberduck/core/PathAttributes.java b/core/src/main/java/ch/cyberduck/core/PathAttributes.java index eaede24331f..b95da23b494 100644 --- a/core/src/main/java/ch/cyberduck/core/PathAttributes.java +++ b/core/src/main/java/ch/cyberduck/core/PathAttributes.java @@ -674,6 +674,9 @@ public boolean equals(final Object o) { if(!Objects.equals(revision, that.revision)) { return false; } + if(!Objects.equals(verdict, that.verdict)) { + return false; + } return true; } @@ -687,6 +690,7 @@ public int hashCode() { result = 31 * result + (versionId != null ? versionId.hashCode() : 0); result = 31 * result + (fileId != null ? fileId.hashCode() : 0); result = 31 * result + (revision != null ? revision.hashCode() : 0); + result = 31 * result + (verdict != null ? verdict.hashCode() : 0); return result; } @@ -714,6 +718,7 @@ public String toString() { sb.append(", region='").append(region).append('\''); sb.append(", metadata=").append(metadata).append('\''); sb.append(", custom=").append(custom).append('\''); + sb.append(", verdict=").append(verdict).append('\''); sb.append('}'); return sb.toString(); } diff --git a/core/src/test/java/ch/cyberduck/core/PathAttributesTest.java b/core/src/test/java/ch/cyberduck/core/PathAttributesTest.java index 8177275ff89..77513a7b72b 100644 --- a/core/src/test/java/ch/cyberduck/core/PathAttributesTest.java +++ b/core/src/test/java/ch/cyberduck/core/PathAttributesTest.java @@ -28,6 +28,7 @@ public void testCopy() { attributes.setDuplicate(true); attributes.setLockId(new AlphanumericRandomStringService().random()); attributes.setPermission(new Permission(644)); + attributes.setVerdict(PathAttributes.Verdict.pending); final PathAttributes clone = new PathAttributes(attributes); assertEquals(clone.getPermission(), attributes.getPermission()); assertEquals(clone.getModificationDate(), attributes.getModificationDate()); @@ -79,6 +80,7 @@ public void testSerialize() { attributes.setDuplicate(true); attributes.setRegion("region"); attributes.setStorageClass("storageClass"); + attributes.setVerdict(PathAttributes.Verdict.pending); final Map custom = new HashMap<>(attributes.getCustom()); custom.put("key", "value"); attributes.setCustom(custom); @@ -93,6 +95,7 @@ public void testSerialize() { assertEquals(attributes.isDuplicate(), deserialized.isDuplicate()); assertEquals(attributes.getRegion(), deserialized.getRegion()); assertEquals(attributes.getStorageClass(), deserialized.getStorageClass()); + assertEquals(attributes.getVerdict(), deserialized.getVerdict()); assertEquals(attributes.getCustom(), deserialized.getCustom()); assertEquals(attributes, deserialized); }