summaryrefslogtreecommitdiff
path: root/java/io/ObjectStreamClass.java
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2006-04-02 21:35:59 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2006-04-02 21:35:59 +0000
commita2e25f76b7dfff38c5309f695806ce8882cfd14c (patch)
tree2dc6dd851bd5862774295978872505445b89b143 /java/io/ObjectStreamClass.java
parent139a0c5f3c4ba93afaf8eb29de10875c6a62e3c7 (diff)
downloadclasspath-a2e25f76b7dfff38c5309f695806ce8882cfd14c.tar.gz
2006-04-02 Andrew John Hughes <gnu_andrew@member.fsf.org>
* java/io/ObjectOutputStream.java: (writeObject(Object)): Added enum support. (writeClassDescriptor(ObjectStreamClass)): Likewise. * java/io/ObjectStreamClass.java: (isEnum()): New package-private method. (setFlags(Class)): Added enum support. * java/io/ObjectStreamConstants.java: (SC_ENUM): Added.
Diffstat (limited to 'java/io/ObjectStreamClass.java')
-rw-r--r--java/io/ObjectStreamClass.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/java/io/ObjectStreamClass.java b/java/io/ObjectStreamClass.java
index 1df7c7ea0..1ca78ed9f 100644
--- a/java/io/ObjectStreamClass.java
+++ b/java/io/ObjectStreamClass.java
@@ -226,6 +226,12 @@ public class ObjectStreamClass implements Serializable
return (flags & ObjectStreamConstants.SC_EXTERNALIZABLE) != 0;
}
+ // Returns true iff the class that this ObjectStreamClass represents
+ // implements Externalizable.
+ boolean isEnum()
+ {
+ return (flags & ObjectStreamConstants.SC_ENUM) != 0;
+ }
// Returns the <code>ObjectStreamClass</code> that represents the
// class that is the superclass of the class this
@@ -594,6 +600,9 @@ outer:
if (writeObjectMethod != null)
flags |= ObjectStreamConstants.SC_WRITE_METHOD;
+
+ if (cl.isEnum() || cl == Enum.class)
+ flags |= ObjectStreamConstants.SC_ENUM;
}
@@ -603,7 +612,7 @@ outer:
{
SetAccessibleAction setAccessible = new SetAccessibleAction();
- if (!isSerializable() || isExternalizable())
+ if (!isSerializable() || isExternalizable() || isEnum())
{
fields = NO_FIELDS;
return;