History log of /libcore/luni/src/main/java/java/io/ObjectInputStream.java
Revision Date Author Comments
d43b9ef11a1095967a3396b246639b563e1a4128 12-Sep-2012 Kenny Root <kroot@google.com> Add consistent reasons for NullPointerException

Semi-automated replacement of empty and non-conforming
NullPointerException reason messages.

(cherry-pick of 86acc043d3334651ee26c65467d78d6cefedd397.)

Change-Id: I6d893979f5c20a50e841e32af9fd7b2d8bc9d54d
86acc043d3334651ee26c65467d78d6cefedd397 12-Sep-2012 Kenny Root <kroot@google.com> Add consistent reasons for NullPointerException

Semi-automated replacement of empty and non-conforming
NullPointerException reason messages.

Change-Id: Iedeb4b21949e973c4042ce5982dda315f2e785e1
20484654bc7c2407da40226d5188acfc37ee1c2b 09-Aug-2011 Elliott Hughes <enh@google.com> Remove more cruft.

Unused imports and bogus comments.

(cherry-pick of 9af8c0318fac8bf03ee145da01b0c38a503791fc.)

Change-Id: I2bddb32028b71964407e86c4dbef5516673c27eb
bd8dfd99b523583c3b5e662975638643e17874ea 28-Jul-2012 Brian Carlstrom <bdc@google.com> NullPointerException invoking Field.getModifiers

Change-Id: I56c5908d16458d36098ffa7e2dc8c3518280f2e3
05895faacf43e6fd2bcd57baed31832f6888cb31 27-Jul-2012 Elliott Hughes <enh@google.com> Fix deserialization of transient fields.

We need to read field data in the stream, but if the field is (now)
transient, we should just ignore the request to set it.

Bug: 4471249
Change-Id: I5336fdeaaef73e912a48be53af75fd9d1b29fccf
19388c1ccaff3ac404956e2d13a69748c17eee72 20-Dec-2011 Jesse Wilson <jessewilson@google.com> Test enum serialization and deserialization.

We had a tiny bug where we were throwing IllegalArgumentException
instead of InvalidObjectException when an enum constant didn't
match.

Bug: http://b/5364970
Change-Id: I6bff3c63379d74f7a062a4a2096d359d2bc45403
32c2297a959b72abdb18743f0519e1d8b7c7ea88 17-Mar-2011 Elliott Hughes <enh@google.com> Remove bogus "super()" calls.

I've left one in java.util.concurrent, since we have an upstream there.

Change-Id: I60945e48a41433fc7eaef6086433ec4bf434097f
3d93b50c1e9d8cb12d17a4331edd27ee2a1dc7a9 11-Mar-2011 Dan Bornstein <danfuzz@android.com> Remove the stopAtPrivileged argument.

It's superfluous now.

Change-Id: I5628797b1296a41bfe72e535efaf18cd17e12fd4
685f9f54501631ef05a9379fa865004dc33a2ae5 24-Feb-2011 Elliott Hughes <enh@google.com> More FindBugs complaints in ObjectInputStream.

I don't know why there was so much bogus (too late) null checking in this code,
but it's not obvious how fieldDesc could ever be null, so I think that removing
the checks rather than fixing them is the right resolution.

Change-Id: I72ee5c048ddebc3678c94f23e4c09dcb2790dfc7
344110141de805108972f0ad24f16de59ba2aa32 23-Feb-2011 Elliott Hughes <enh@google.com> Fix more FindBugs complaints (BufferedReader, File, and ObjectInputStream).

Also slightly improve the documentation of Random and SecureRandom.

Change-Id: I47b23cef33958fffb4254c9942849ae7b52136f1
e26ba79900d471d02d656f686926918ef7dc751f 08-Feb-2011 Elliott Hughes <enh@google.com> Use int.class instead of Integer.TYPE (et cetera) for clarity.

I've also removed some small amount of duplication and a few unused imports.

Change-Id: Ie52477484bade74c80a348ad1261b596f9053cf6
6186821cb13f4ac7ff50950c813394367e021eae 08-Feb-2011 Jesse Wilson <jessewilson@google.com> Move libcore.base classes to libcore.util and libcore.io.

Change-Id: I2340a9dbad3561fa681a8ab47d4f406e72c913e3
fb0ec0e650bf8be35acb0d47da0311a7c446aa33 14-Jan-2011 Elliott Hughes <enh@google.com> Remove useless android-changed comments.

I've changed useful ones to regular comments or TODOs, as appropriate.

I've left ones in code like java.util.concurrent where we really are
tracking an upstream source, making the change markers useful.

I've left a handful of others where I intend to actually investigate
the implied TODOs before deciding how to resolve them.

Change-Id: Iaf71059b818596351cf8ee5a3cf3c85586051fa6
2f2001f2f769c710ce7ee63412d3e2580388bf4d 07-Jan-2011 Elliott Hughes <enh@google.com> Remove redundant "throws SecurityException" clauses.

These were unchecked exceptions anyway, and now they can't even be thrown.

Bug: 2585285
Change-Id: Ifc8048262fe4b1699924241944beaa6a5bf09e0a
ad41624e761bcf1af9c8008eb45187fc13983717 07-Jan-2011 Elliott Hughes <enh@google.com> Retire SecurityManager.

This change removes all the code that was calling getSecurityManager, and
removes all use of AccessController.doPrivileged. It also changes the
implementation of AccessController so it doesn't actually do anything; it's
only there for source-level compatibility.

Bug: 2585285
Change-Id: I1f0295a4f12bce0316d8073011d8593fee116f71
e270027a8e421200a6af45f066c3a6aabe03aa30 16-Dec-2010 Elliott Hughes <enh@google.com> Fix a long-standing serialization bug.

Fixes a harmony test.

This patch touches two very similar-looking methods that are sadly just
different enough that we can't factor the duplication out until we can
rely on inlining.

Change-Id: I9c47f08911fea1472c2cb36b7cf94ab6a4e630aa
f24bce74a497ed281de23b7e997549725557b730 16-Dec-2010 Elliott Hughes <enh@google.com> Fix a regression I introduced in serialization.

Although the serialization specification strongly implies that there
are no gaps in the allocated handles, it's not actually true of the RI
or -- presumably for bug-compatibility reasons -- of us. Serializing
anything with a field of type Class skips a handle; our EnumMapTest
found this.

By way of apology, I've thrown in a one-line fix for a long-standing
bug (no support for void).

Change-Id: I6104f8cb8e5a1476448ad65669e54f191c1a60e3
6c9fda83af2a99ab25cf5ad0487c6d4c6f1e7cb1 15-Dec-2010 Elliott Hughes <enh@google.com> A last bit of serialization performance on the deserialization side.

There's no point converting a Class<?> to a char and then doing (effectively)
an if-else on the char when we can do it on the Class<?> directly. With this
change, the profile for deserialization is quite reasonable: mostly object
creation and ploughing through the bytes. We'll benefit from future Arrays
work, but that's for another day.

Bug: http://code.google.com/p/android/issues/detail?id=13138
Change-Id: I67aa237c4176e443f7ecdc12f0534cc2f3df5076
08d5f1955b94e07e337c59b63a7051879fa3bbef 15-Dec-2010 Elliott Hughes <enh@google.com> More serialization performance.

Similar to caching the ObjectStreamClass hierarchy, cache the Class<?>
hierarchy.

Bug: http://code.google.com/p/android/issues/detail?id=13138
Change-Id: Idb115f2d80224ee9809461b58d0fef1abfc7ac30
46241f2f67d7b90e20f3301861f807f330687821 14-Dec-2010 Elliott Hughes <enh@google.com> More serialization performance work.

Cache the ObjectStreamClass hierarchy. Serialization needs to traverse this
from root to leaf but we don't have links in that direction. This patch
ensures we at least only compute it once.

Bug: http://code.google.com/p/android/issues/detail?id=13138
Change-Id: Ia7e8f5cc431ddba5db72ef3cb2d24bdf8e263de2
6523532145f06d8c208ed7a9374d3ab6d8132e66 14-Dec-2010 Elliott Hughes <enh@google.com> More serialization performance improvements.

Cache more work and don't use a Map of Integers for a range of
integers that's defined to be dense, just because they don't start at 0.

Bug: http://code.google.com/p/android/issues/detail?id=13138
Change-Id: Ie73d0bb946892f86165fca78da10bbcf64322570
32ef29bcbfdce08d58ea72bd15a12a96065bdbb6 13-Dec-2010 Elliott Hughes <enh@google.com> Make deserialization 30% faster.

Cache the constructor we need, rather than looking it up each time.

Bug: http://code.google.com/p/android/issues/detail?id=13138
Change-Id: I33f34d2e566c8a39296b7e820cab2d2c535d84e8
b46dab348e2007bc08abaf7ecae34d89a2474e50 09-Dec-2010 Elliott Hughes <enh@google.com> Rewrite all backwards comparisons.

Strictly, all the ones I could find. This is everything with 0 or null on the
left-hand side.

Note that this touches several incorrect bounds checks, which I haven't fixed:
I'm going to come back and finish that independent cleanup separately.

Change-Id: Ibdb054b53df9aace47c7d2a00ff19122190053e8
b9cc455ed89df1a0cf4186c92b352c9649995d96 04-Dec-2010 Elliott Hughes <enh@google.com> Use our canonical Arrays range-checking methods.

There are a handful of manual range-checkers left, thanks to specified
API that throws IllegalArgumentException instead, and a few other weird
cases.

Change-Id: I80914c2257288fc184100545aff4fd6f57bf32c9
b854a55df2475a4e9acc96c271cd88da7559f019 16-Nov-2010 Elliott Hughes <enh@google.com> Switch ObjectInputStream over to reflection.

Reduces the amount of (native) code, and improves perfromance.

We can't entirely remove the native code this time because we
rely on the ability to create an instance of one class while
calling a constructor from another, which we can't do via
reflection.

Bug: 3158451
Change-Id: I896e23a6ffd7b7f1a016ff9d30cea0b2b9df7574
7d0d108593ac30e19b8f2a5a157f697f3f46c041 13-Nov-2010 Elliott Hughes <enh@google.com> Switch ObjectOutputStream over to reflection.

Reduces the amount of (native) code, and improves performance. I've also
improved some of the detail messages from the reflection code (to help in
my own debugging).

I'll do ObjectInputStream next...

Bug: 3158451
Change-Id: Icf06a17507f9d011d120f2d704e084a103a400c7
693eacca9fa67ad79d1b35dbaad61c5ac1ac457c 10-Nov-2010 Elliott Hughes <enh@google.com> Stop allocating empty arrays.

Bug: 3166662
Change-Id: I151de373b2bf53786d19824336fa434c02b0b0e8
0eb70e31581a977afa5df3292d1c96e42e548821 28-Oct-2010 Elliott Hughes <enh@google.com> Optimize DataInputStream and a few friends.

Also ensure that we're doing a correct readFully when reading
shorts/ints/longs.

Bug: 3032515
Change-Id: I39e6f926537f5d55063db8fc1c5a1b4b794746d4
2543351c360bdfe0046e819dedb069f3724d703a 01-Sep-2010 Jesse Wilson <jessewilson@google.com> Fixing warnings in ObjectInputStream, including possible null dereferences.

See http://b/issue?id=2099718

Change-Id: I74db9e216c0d2568823c313aeeb91fdef72ae00a
e22935d3c7040c22b48d53bd18878844f381287c 13-Aug-2010 Elliott Hughes <enh@google.com> Remove most of our C-style casts.

After being burned by an incorrect C-style cast that cast away const, I've been
keen to remove them all and turn on -Wold-style-cast. This patch doesn't get us
that far, but it does kill the majority of our C-style casts. In turn, the
majority of the casts that it removes are the ones from our tables of native
methods to be registered.

The new NATIVE_METHOD macro also _enforces_ our convention of using the
"Class_nativeMethod" style of naming. Mostly this works out fine. In some
cases (most notably ExpatParser and ExpatAttributes) I've had to un-overload
a few functions, but I don't like overloading anyway, and in the particular
case of a native method, where the stack trace doesn't show a line number,
overloading makes it one step harder to work out which native method you're
actually in. So good riddance to that. The only unfortunate case is
Math.copySign, where there are two overloads corresponding to copysign(3)
and copysignf(3). I had to add an extra layer of indirection there. In my
defense, we've never shipped these functions before, they're unlikely to
become anyone's hotspot, and the right fix is to be doing such trivial work
on the Java side anyway, with intrinsics making the conversion between
float/double and int/long cheap.

This patch also replaces other C-style casts, primarily in
"OSNetworkSystem.cpp".

This patch also removes unnecessary uses of the "struct" keyword.

This patch also fixes a "may be used uninitialized" warning (now error) in
the sim build for "ICU.cpp".

The remaining C-style casts are in the hairy float-parsing code. That stuff --
and turning on -Wold-style-cast -- will have to wait for another day.

Change-Id: I9b3ee14aefd4676f980f6a7ca757595d78d80e6a
7365de1056414750d0a7d1fdd26025fd247f0d04 12-Aug-2010 Jesse Wilson <jessewilson@google.com> Sorting imports.

Change-Id: I8347bc625480a1c37a1ed9976193ddfedeb00bbc
b1396870f92135aa140bd2b86221768dea5bc11d 25-May-2010 Elliott Hughes <enh@google.com> Remove the luni localized exception messages.

Also fix a bug I introduced in KXmlSerializer: s.isEmpty() is not
equivalent to "".equals(s) if s is allowed to be null.

Bug: 1251121
Change-Id: I41a0a98ffb49f214041c9110f824d327af5c34e8
d21d78fd49a2d798218e8c8aefbddb26a0e71bbb 13-May-2010 Elliott Hughes <enh@google.com> Convert tabs to spaces.

Change-Id: I16cfbd2faac6b565b78b5dd97e2345323a36f652
fd6bb3510c2f94d636f3572dcf5f7f4dcd1a2726 13-May-2010 Elliott Hughes <enh@google.com> Remove //$NON-NLS-\d$ cruft.

Mostly done by perl(1), with manual cleanup of the few misspelled instances.
This makes our trailing whitespace slightly worse, but I'll fix all that with
a follow-on change.

Change-Id: I0b4ca98819be6f9519c4ba980d759bd1ee1a0303
03c0a8e681c776fdba0389ab8593282139afc6d6 14-Apr-2010 Elliott Hughes <enh@google.com> Remove "Messages" from the nio, prefs, sql, text, and x-net modules.

Also remove an file of unused messages from luni, and inline one of luni's
other files. (There are plenty more.)

Also remove some German translations of bouncycastle messages (that are
actually in English anyway).

Change-Id: I9c565f6f2201a5d877eba5bf0af4ffad7b769984
582d926fbf5f5fd4800def67f86ecfedee44681e 05-Apr-2010 Elliott Hughes <enh@google.com> Froyo InputStream.available documentation improvement.

This method causes a lot of confusion, and we can do a lot better. (Ideally,
the API would either not exist or be something like "public boolean ready()".)

I've removed poor-quality documentation overrides too, so the full
documentation is visible in most places. (InflaterInputStream is an obvious
exception.)

Also, to a lesser extent, improve the InputStream.skip documentation.

Change-Id: I6d6cd788e6a32ad4a2613d1e381610f1ad8575fe
4fefecee9d4a5d2a4510f516b4015607b19e8d09 13-Nov-2009 Jean-Baptiste Queru <jbq@google.com> eclair snapshot
5839b909d9528b7726e678a4b696ed37df15d897 10-Oct-2009 Jesse Wilson <jessewilson@google.com> Udating luni to Harmony r823222.

Highlights:
- InputStream.skip concurrency issue
- "better" messages in bound exceptions for streams and arrays
- prefer fewer writes to underlying streams (using byte[] buffers)
- Rename subclasses to not reuse names from their superclasses
- PlatformAddressFactory.allocMap bugfix

Plus some spelling fixes, style fixes, serial version UIDs and other
boilerplate improvements.
5905afbf06aa390d6e580d75f3e1419f9cf67472 30-Sep-2009 Jesse Wilson <jessewilson@google.com> Fixing a Harmony regression in ObjectInputStream.

We check the field type against the instance being
populated and not the field descriptor on the wire.
The root cause is a bug in Harmony which we should
send upstream.
f5597e626ecf7949d249dea08c1a2964d890ec11 25-Jul-2009 Jesse Wilson <jessewilson@google.com> Integrate luni module (but not tests) to Harmony r772995.

Notable changes
- Stripped "@since Android 1.0" from many files. Most files
are now 100% the same in Dalvik and Harmony.
- AbstractStringBuilder.reverse() supports surrogates
- AbstractStringBuilder shares less to waste less memory
- Bitset optimized
- BufferedInputStream changed to support unsynchronized close()
- BufferedOutputStream does flushInternal
- BufferedReader supports EBCDIC NEL
- Collections.synchronizedList().indexOf() does a copy for more concurrency
- Classes in nio module changed: DatagramChannelImpl, SocketChannelImpl
and ServerSocketChannelImpl (these depend on internal APIs changed in
this update)
- DataInputStream/DataOutputStream now use a small buffer to limit the
number of times the underlying stream is accessed
- Date now has a minutes offset, more efficient toString()
- ExposedByteArrayInputStream: new internal class
- DeleteOnExit moved to top-level class
- FileDescriptor.isValid() now non-native
- Float, Double lessThan optimized (fix for compare(-0.0F, 0.0F) still pending)
- FileURLConnection now guesses content types from streams
- HashMap iterator changes
- Hashtable iterator changes
- INetworkSystem
- removes bind2(), createMulticastSocket, sendStream(),
- renames createSocket to createStreamSocket
- JarURLConnection rewritten
- LinkedHashMap: new iterator
- Locale, Currency, TimeZone: now use ICU in Harmony, plain Java in Dalvik
- ObjectInputStream: Accessor objects in Harmony, direct native in Dalvik
- ProxyClassFile - many changes
- String - optimized ascii for toLowerCase, toUpperCase, compare
- Timer - rewritten
- TreeMap - rewritten
- URLClassLoader - new
- URLConnection - new guessContentTypeFromStream(), uses org.apache.harmony.awt.www.content
to lookup content type handlers
adc854b798c1cfe3bfd4c27d68d5cee38ca617da 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
1c0fed63c71ddb230f3b304aac12caffbedf2f21 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
a0881d052ee72e3f7e773374e9b1aa75fbd6be4c 10-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@125939
dd828f42a5c83b4270d4fbf6fce2da1878f1e84a 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
fdb2704414a9ed92394ada0d1395e4db86889465 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution