summaryrefslogtreecommitdiff
path: root/java/io/ObjectStreamClass.java
diff options
context:
space:
mode:
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 203e4a5ab..abb26d839 100644
--- a/java/io/ObjectStreamClass.java
+++ b/java/io/ObjectStreamClass.java
@@ -219,6 +219,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
@@ -587,6 +593,9 @@ outer:
if (writeObjectMethod != null)
flags |= ObjectStreamConstants.SC_WRITE_METHOD;
+
+ if (cl.isEnum() || cl == Enum.class)
+ flags |= ObjectStreamConstants.SC_ENUM;
}
@@ -596,7 +605,7 @@ outer:
{
SetAccessibleAction setAccessible = new SetAccessibleAction();
- if (!isSerializable() || isExternalizable())
+ if (!isSerializable() || isExternalizable() || isEnum())
{
fields = NO_FIELDS;
return;