-
Bug
-
Resolution: Fixed
-
P3
-
5.0
-
b07
-
sparc
-
solaris_8
-
Not verified
Name: ygR10224 Date: 07/19/2004
Filed By : SPB JCK team
JDK : java full version "1.5.0-beta3-b58"
JCK : 1.5
Platform[s] : Solaris
switch/Mode :
JCK test owner : http://javaweb.eng/jct/sqe/JCK-tck/usr/owners.jto
Failing Test [s] : None
Specification excerpt:
======================
--------- J2SE API spec v.1.5 ---------
...
Class java.lang.Enum extends Object implements Serializable
Serialized Fields
name
String name
The name of this enum constant, as declared in the enum declaration.
Most programmers should use the Enum.toString() method rather than
accessing this field.
ordinal
int ordinal
The ordinal of this enumeration constant (its position in the
enum declaration, where the initial constant is assigned an ordinal of
zero). Most programmers will have no use for this field. It is designed
for use by sophisticated enum-based data structures, such as EnumSet and
EnumMap.
---------- end-of-excerpt ---------------
Problem description
===================
Serialized Form documentation for class java.lang.Enum
define two fields. But Java Object Serialization Specification
(http://java.sun.com/j2se/1.5/pdf/serial-1.5.0.pdf)
states (page 11, "1.12 Serialization of Enum Constants")
the following about serialization of the enum-type constants:
---
...
Enum constants are serialized differently than ordinary serializable or
externalizable objects. The serialized form of an enum constant consists
solely of its name; field values of the constant are not present in the
form.
...
---
So Serialized Form javadoc for java.lang.Enum is ambiguous and
should be bring in correspondence with JOSS.
======================================================================
- csr for
-
JDK-8209524 (enum) Serialized Form javadoc for java.lang.Enum is misleading
-
- Closed
-
- relates to
-
JDK-8209542 Serialization discussion of enum types should mention java.lang.Enum
-
- Open
-
-
JDK-8028032 EnumSet serial form documentation is deficient
-
- Open
-