summaryrefslogtreecommitdiffstats
path: root/luni/src/main/java/java/io/ObjectInputStream.java
diff options
context:
space:
mode:
Diffstat (limited to 'luni/src/main/java/java/io/ObjectInputStream.java')
-rw-r--r--luni/src/main/java/java/io/ObjectInputStream.java11
1 files changed, 4 insertions, 7 deletions
diff --git a/luni/src/main/java/java/io/ObjectInputStream.java b/luni/src/main/java/java/io/ObjectInputStream.java
index f26549d..17a6974 100644
--- a/luni/src/main/java/java/io/ObjectInputStream.java
+++ b/luni/src/main/java/java/io/ObjectInputStream.java
@@ -23,7 +23,6 @@ import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
import java.lang.reflect.Proxy;
import java.util.ArrayList;
import java.util.Arrays;
@@ -1064,12 +1063,10 @@ public class ObjectInputStream extends InputStream implements ObjectInput, Objec
}
for (ObjectStreamField fieldDesc : fields) {
- Field field = classDesc.getReflectionField(fieldDesc);
- if (field != null && Modifier.isTransient(field.getModifiers())) {
- field = null; // No setting transient fields! (http://b/4471249)
- }
- // We may not have been able to find the field, or it may be transient, but we still
- // need to read the value and do the other checking...
+ // checkAndGetReflectionField() can return null if it was not able to find the field or
+ // if it is transient or static. We still need to read the data and do the other
+ // checking...
+ Field field = classDesc.checkAndGetReflectionField(fieldDesc);
try {
Class<?> type = fieldDesc.getTypeInternal();
if (type == byte.class) {