changeset 12403:6f728e38a695

8076401: Serialize OIS data Reviewed-by: alanb, igerasim
author chegar
date Fri, 17 Apr 2015 15:28:44 +0100
parents 62e470dd1f94
children 098db82c3351
files src/java.base/share/classes/java/io/ObjectInputStream.java
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/io/ObjectInputStream.java	Thu Apr 16 11:27:23 2015 +0300
+++ b/src/java.base/share/classes/java/io/ObjectInputStream.java	Fri Apr 17 15:28:44 2015 +0100
@@ -1906,10 +1906,9 @@
             ObjectStreamClass slotDesc = slots[i].desc;
 
             if (slots[i].hasData) {
-                if (obj != null &&
-                    slotDesc.hasReadObjectMethod() &&
-                    handles.lookupException(passHandle) == null)
-                {
+                if (obj == null || handles.lookupException(passHandle) != null) {
+                    defaultReadFields(null, slotDesc); // skip field values
+                } else if (slotDesc.hasReadObjectMethod()) {
                     SerialCallbackContext oldContext = curContext;
 
                     try {
@@ -1946,6 +1945,7 @@
                         defaultSetFieldValues(obj, slotDesc, vals);
                     }
                 }
+
                 if (slotDesc.hasWriteObjectData()) {
                     skipCustomData();
                 } else {