6277781: Serialization of Enums over IIOP is broke.
authorrobm
Mon, 15 Nov 2010 10:46:40 -0800
changeset 7196 41f71f4690d5
parent 7195 abbc60eaf512
child 7197 a3c4c326e934
6277781: Serialization of Enums over IIOP is broke. Summary: Reviewed by Ken Cavanaugh Reviewed-by: coffeys
corba/src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java
--- a/corba/src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java	Sat Nov 13 18:39:26 2010 -0800
+++ b/corba/src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java	Mon Nov 15 10:46:40 2010 -0800
@@ -1012,7 +1012,11 @@
              * else,
              *  Handle it as a serializable class.
              */
-            if (currentClassDesc.isExternalizable()) {
+            if (Enum.class.isAssignableFrom( clz )) {
+                int ordinal = orbStream.read_long() ;
+                String value = (String)orbStream.read_value( String.class ) ;
+                return Enum.valueOf( clz, value ) ;
+            } else if (currentClassDesc.isExternalizable()) {
                 try {
                     currentObject = (currentClass == null) ?
                         null : currentClassDesc.newInstance();