Skip to content

Commit

Permalink
Added smart overrides for SafeSimpleDateFormat so that it delegates t…
Browse files Browse the repository at this point in the history
…o the contain SimpleDateFormat instead for hashCode() and equals().
  • Loading branch information
jdereg committed Jan 27, 2024
1 parent 55910f3 commit 3efe2b2
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

0 comments on commit 3efe2b2

Please sign in to comment.