summaryrefslogtreecommitdiff
path: root/java/io/ObjectOutputStream.java
diff options
context:
space:
mode:
authorGuilhem Lavaux <guilhem@kaffe.org>2006-06-08 20:19:53 +0000
committerGuilhem Lavaux <guilhem@kaffe.org>2006-06-08 20:19:53 +0000
commit2f94810a11e0e3cdeb4bed695a4bf9eb9ce41c34 (patch)
treec5e2c0011d6dd129dbdc8da0273cdaff7b1bc3f6 /java/io/ObjectOutputStream.java
parent56c5b96a2d3754736d13eebb73270fb8f925301d (diff)
downloadclasspath-2f94810a11e0e3cdeb4bed695a4bf9eb9ce41c34.tar.gz
2006-06-07 Guilhem Lavaux <guilhem@kaffe.org>native_layer_merge_head_2006_06_06
* Merged HEAD as of 2006-06-06. * native/jni/native-lib/cpproc.h (CPIO_EXEC_NUM_PIPES): Compilation fix.
Diffstat (limited to 'java/io/ObjectOutputStream.java')
-rw-r--r--java/io/ObjectOutputStream.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/java/io/ObjectOutputStream.java b/java/io/ObjectOutputStream.java
index 61f07bc7c..80d196bce 100644
--- a/java/io/ObjectOutputStream.java
+++ b/java/io/ObjectOutputStream.java
@@ -253,7 +253,17 @@ public class ObjectOutputStream extends OutputStream
ObjectStreamClass osc = ObjectStreamClass.lookupForClassObject(clazz);
if (osc == null)
throw new NotSerializableException(clazz.getName());
-
+
+ if (osc.isEnum())
+ {
+ /* TC_ENUM classDesc newHandle enumConstantName */
+ realOutput.writeByte(TC_ENUM);
+ writeObject(osc);
+ assignNewHandle(obj);
+ writeObject(((Enum) obj).name());
+ break;
+ }
+
if ((replacementEnabled || obj instanceof Serializable)
&& ! replaceDone)
{
@@ -432,7 +442,10 @@ public class ObjectOutputStream extends OutputStream
{
realOutput.writeByte(TC_CLASSDESC);
realOutput.writeUTF(osc.getName());
- realOutput.writeLong(osc.getSerialVersionUID());
+ if (osc.isEnum())
+ realOutput.writeLong(0L);
+ else
+ realOutput.writeLong(osc.getSerialVersionUID());
assignNewHandle(osc);
int flags = osc.getFlags();