JDK-4838379 : Need custom support for serializing enum types
Type:Enhancement
Component:core-libs
Sub-Component:java.io:serialization
Affected Version:5.0
Priority:P3
Status:Resolved
Resolution:Fixed
OS:solaris_8
CPU:generic
Submitted:2003-03-27
Updated:2017-05-16
Resolved:2003-09-05
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.
Enumerated types require special serialization support.
Comments
CONVERTED DATA
BugTraq+ Release Management Values
COMMIT TO FIX:
tiger
FIXED IN:
tiger
INTEGRATED IN:
tiger
tiger-b19
14-06-2004
EVALUATION
Strictly speaking we don't "need" custom support for serializing enum types:
the compiler could simply emit an appropriate readObject method. This
approach, however, has several disadvantages: (1) It would place a fair
amount of unnecessary code in the class files. (2) The details will have to
be spelled out to ensure consistency among compilers. (3) The resulting
serialized form would be inefficient in space and time; it would contain a
meaningless serial version UID and would construct and discard a "garbage
object" each time an enum constant was deserialized. Therefore, it seems
reasonable to add "first class" serialization support for enum types, as was
done for strings and arrays.
###@###.### 2003-03-31