summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Wilson <jessewilson@google.com>2009-10-01 12:20:48 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2009-10-01 12:20:48 -0700
commit128041b19c25037bb6b60830c0d53f11a1b3f77e (patch)
treeaf1701adb9010fdfa1bae93275f905b1ff813213
parenta9e9a5e49c54c4b35b51e2eaf6f71f55774bbf79 (diff)
parent4aef7e73e12297767f165c585fec6e4b574e67d1 (diff)
downloadlibcore-128041b19c25037bb6b60830c0d53f11a1b3f77e.zip
libcore-128041b19c25037bb6b60830c0d53f11a1b3f77e.tar.gz
libcore-128041b19c25037bb6b60830c0d53f11a1b3f77e.tar.bz2
am a20c6d23: am b5b7f4ba: Merge change I9899be9d into eclair
Merge commit 'a20c6d2347224d89dced471e61a36610699b7e71' * commit 'a20c6d2347224d89dced471e61a36610699b7e71': Fixing a Harmony regression in ObjectInputStream.
-rw-r--r--luni/src/main/java/java/io/ObjectInputStream.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/luni/src/main/java/java/io/ObjectInputStream.java b/luni/src/main/java/java/io/ObjectInputStream.java
index 7dc87ff..6d24eb2 100644
--- a/luni/src/main/java/java/io/ObjectInputStream.java
+++ b/luni/src/main/java/java/io/ObjectInputStream.java
@@ -1323,7 +1323,13 @@ public class ObjectInputStream extends InputStream implements ObjectInput,
}
if (fieldDesc != null) {
if (toSet != null) {
- Class<?> fieldType = fieldDesc.getType();
+ // BEGIN android-changed
+ // Get the field type from the local field rather than
+ // from the stream's supplied data. That's the field
+ // we'll be setting, so that's the one that needs to be
+ // validated.
+ Class<?> fieldType = field.getTypeInternal();
+ // END android-added
Class<?> valueType = toSet.getClass();
if (!fieldType.isAssignableFrom(valueType)) {
throw new ClassCastException(Msg.getString(