--- a/jdk/src/java.base/share/classes/java/io/ObjectInputStream.java Thu Apr 16 11:27:23 2015 +0300
+++ b/jdk/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 {