United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6877056 SVUID calculated for java.lang.Enum is not 0L
6877056 : SVUID calculated for java.lang.Enum is not 0L

Details
Type:
Bug
Submit Date:
2009-08-28
Status:
In Progress
Updated Date:
2011-03-29
Project Name:
JDK
Resolved Date:
Component:
other-libs
OS:
windows_xp
Sub-Component:
corba:orb
CPU:
x86
Priority:
P2
Resolution:
Unresolved
Affected Versions:
5.0
Targeted Versions:
5.0-pool

Related Reports
Backport:
Backport:
Backport:
Backport:
Relates:
Relates:

Sub Tasks

Description
FULL PRODUCT VERSION :


ADDITIONAL OS VERSION INFORMATION :
Windows_NT <MACHINE NAME> 5 01 586

A DESCRIPTION OF THE PROBLEM :
For the class java.lang.Enum, as per Java to IDL mapping spec example, the SVUID should be 0L. The SVUID calculated by com.sun.corba.se.impl.io.ObjectStreamClass for java.lang.Enum is not 0L. Also, in the hashcode calculation, the getFields() method does NOT return 0 fields for java.lang.Enum.

In java.io.ObjectStreamClass however, we have the following code:

 if (isEnum) {
    suid = Long.valueOf(0);
    fields = NO_FIELDS;
    return null;
}

Shouldn't the same be done in com.sun.corba.se.impl.io.ObjectStreamClass?
Shouldn't the SVUID be 0L, and getFields return NO_FIELDS?

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
i was expecting the SVUID to be 0L, and the getFields to return NO_FIELDS.
ACTUAL -
SVUID is not 0L, and getFields returns an array of length 2

REPRODUCIBILITY :
This bug can be reproduced always.

                                    

Comments
EVALUATION

http://hg.openjdk.java.net/jdk7/build/corba/rev/5d9708346d50
                                     
2010-12-25
SUGGESTED FIX

webrev for jdk5:
http://jpsesvr.sfbay.sun.com:8080/ctetools/html/ViewDetail.jsp?index=3190
                                     
2010-07-27
EVALUATION

com.sun.corba.se.impl.io.ObjectStreamClass has no support for Enums.
Need to update the CORBA version with the same kind of handling of Enums as in java.io.ObjectStreamClass.
                                     
2009-09-21



Hardware and Software, Engineered to Work Together