JDK-6877056 : SVUID calculated for java.lang.Enum is not 0L
  • Type: Bug
  • Component: other-libs
  • Sub-Component: corba:orb
  • Affected Version: 5.0
  • Priority: P2
  • Status: Closed
  • Resolution: Won't Fix
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2009-08-28
  • Updated: 2013-07-15
  • Resolved: 2013-07-15
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.

To download the current JDK release, click here.
JDK 6 JDK 7
6u17-revFixed 7Fixed
Related Reports
Relates :  
Relates :  
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
Fixed in JDK 6 and JDK7. If fix is needed for JDK5 than reopen it with the escalation as no public release is scheduled for JDK5
15-07-2013

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

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

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.
21-09-2009