From 3efe2b2068da9be7a29d6384555c3917c4e1ebf0 Mon Sep 17 00:00:00 2001 From: John DeRegnaucourt Date: Sat, 27 Jan 2024 17:52:50 -0500 Subject: [PATCH] Added smart overrides for SafeSimpleDateFormat so that it delegates to the contain SimpleDateFormat instead for hashCode() and equals(). --- .../java/com/cedarsoftware/util/SafeSimpleDateFormat.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/cedarsoftware/util/SafeSimpleDateFormat.java b/src/main/java/com/cedarsoftware/util/SafeSimpleDateFormat.java index 0c7ecb122..94e016d4d 100644 --- a/src/main/java/com/cedarsoftware/util/SafeSimpleDateFormat.java +++ b/src/main/java/com/cedarsoftware/util/SafeSimpleDateFormat.java @@ -114,4 +114,12 @@ public void set2DigitYearStart(Date date) public String toString() { return _format.toString(); } + + public boolean equals(Object other) { + return getDateFormat(_format).equals(other); + } + + public int hashCode() { + return getDateFormat(_format).hashCode(); + } } \ No newline at end of file