-
Key: I2JAV11-32
-
Legacy Issue Number: 4271
-
Status: closed
-
Source: Anonymous
-
Summary:
an earlier issue (#1752) described the problem that the singleton
assumption for Java enum objects does not hold if these Java
objects are serialized, i.e. stored in a file.The issue was closed without any comments, it seems
(http://cgi.omg.org/issues/issue1752.txt.) However, the problem
remains and is aggravated by the fact that in the more recent documents
mappend Java enum classes are required to transitively implement
java.io.Serializable! This means that the "singleton assumption"
is broken as soon as an enum object is read in from a file, and
equality tests fail, e.g. in generated code of unions that have
enum switch types!I would thus ask for the same thing as Bruce Schuchardt did back
then (quoted from the original mail for issue #1752):> Please consider revising the mapping of enums to require generation
> of equality and hash methods that are class and value based.
> Application developers should then be advised to use equals()
> when comparing enum objects.This is the only way to reconcile enums with Java serialization!
Regards, Gerald Brose.
-
Reported: I2JAV 1.0 — Sat, 14 Apr 2001 04:00 GMT
-
Disposition: Resolved — I2JAV 1.1
-
Disposition Summary:
Incorporate the revised text and close issue
-
Updated: Fri, 6 Mar 2015 20:58 GMT
I2JAV11 — IDL/Java issue, Mapping for IDL enum
- Key: I2JAV11-32
- OMG Task Force: IDL to Java December 2000 RTF