JDK-6525396 : LTP: java.beans.XMLEncoder does not serialize as xml java.sql.Timestamp members
Type:Bug
Component:client-libs
Sub-Component:java.beans
Affected Version:7
Priority:P4
Status:Closed
Resolution:Fixed
OS:solaris_10,windows_xp
CPU:x86
Submitted:2007-02-15
Updated:2011-03-08
Resolved:2011-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
The java.beans.XMLEncoder class does not serialize java.sql.Timestamp.
However, it does serialize into xml java.util.Date, java.sql.Date, java.sql.Time.
Comments
EVALUATION
Method mutatesTo should be rewritten.
The equals() method could not be used, because Timestamp does not have constructor that instantiates the equal object. So we should initialize additional property (nanos) after constructor, but Encoder engine cannot operate with multiple expressions/statements in the instantiate() method.
We can create new clone of Timestamp that can be mutated to original one. So we should compare only base property (time), that is available for all date/time object.