Verify ObjectInputStream against upstream OpenJDK 8u121-b13.

ObjectInputFilter is internal only mechanism in 8u121-b13 which is not
used by Android so we treat it as having been removed. In 9+ it is part
of the external API so when we update to 9+ we can revisit whether we
should add support for it.

ObjectStreamClassValidator is also internal only mechanism in both 8
so we treat it as having been removed. As far as I can tell this is not
public in 9+.

readClassDesc(..) integrated some upstream refactorings to reduce
diffs, exclude call to validateDescriptor which uses
ObjectStreamClassValidator.

readSerialData(..) excluded an upstream bug fix to handle a ThreadDeath
Error as the Thread.stop() method which causes the ThreadDeath Error to
be thrown is not supported on Android.

Took some changes from upstream to track counting bytes read as while
that information is not currently used on Android it constituted quite
a lot of Android changes for what seems to be little benefit.

Added some incorrect formatting present upstream. Is corrected in 9+
so will be fixed while integrating those changes.

Test: make checkbuild
Bug: 35910877
Bug: 37311917
Change-Id: I645b4a30901c8faf1949c73ddfbac6908dd0eed4
1 file changed