Details
-
Bug
-
Resolution: Fixed
-
Major
-
2.0
-
None
-
Unknown
-
Description
DateProperty holds a Date value, this value can be set directly, by clone() or by hibernate. Hibernate mapping is configured to use a timestamp (java.sql.Timestamp) while our code uses Dates (java.util.Date). This is a problem when we compare properties:
if (!oldProperty.toText().equals(((newProperty == null) ? "" : newProperty.toText())))
#toText() uses toString() and since Timestamp overrides toString() it leads to uncorrect equals() statements. I suggest a cautious fix, using a formatter (the one currently in DateProperty#getXMLString()) instead of using toString(), this way the output of #toText() would be consistent no matter the type of the DateProperty value (Timestamp or Date).
Attachments
Issue Links
- is duplicated by
-
XPWATCHLIST-78 Empty object property diffs appears in the notification email when an object is modified
- Closed