changeset 11037:d18bd90c39ed

8076401: Serialize OIS data Reviewed-by: alanb, chegar
author igerasim
date Mon, 20 Apr 2015 15:07:16 +0300
parents e81c940c526d
children bb702e917bad
files src/share/classes/java/io/ObjectInputStream.java
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/io/ObjectInputStream.java	Thu Apr 16 11:27:23 2015 +0300
+++ b/src/share/classes/java/io/ObjectInputStream.java	Mon Apr 20 15:07:16 2015 +0300
@@ -1883,10 +1883,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 {
@@ -1917,6 +1916,7 @@
                 } else {
                     defaultReadFields(obj, slotDesc);
                 }
+
                 if (slotDesc.hasWriteObjectData()) {
                     skipCustomData();
                 } else {