[jdk17u] Integrated: 8277093: Vector should throw ClassNotFoundException for a missing class of an element

Roger Riggs rriggs at openjdk.java.net
Tue Nov 23 15:28:18 UTC 2021


On Wed, 17 Nov 2021 14:37:14 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

> Java.util.Vector reports a StreamCorruptedException instead of ClassNotFoundException due to the incorrect handling of a missing class by ObjectInputStream.GetField.get(name, val). (See JDK-8273660)
> 
> Vector checks the deserialized 'data' field for null and throws StreamCorruptedException.
> The null can be a reflection of more than one condition, including the field is null, the field is not present in the stream, and the field is null because one of the array elements could not be deserialized due to a missing class. 
> 
> The CSR includes a detailed description: JDK-8277153
> 
> This fix is targeted at JDK 17 and earlier versions.
> For the JDK project (current) the underlying API and behavior is corrected to correctly throw and handle the ClassNotFoundException.  
> See [JDK-8276665: ObjectInputStream.GetField.get(name, object) should throw ClassNotFoundException](https://bugs.openjdk.java.net/browse/JDK-8276665)

This pull request has now been integrated.

Changeset: 85716333
Author:    Roger Riggs <rriggs at openjdk.org>
URL:       https://git.openjdk.java.net/jdk17u/commit/857163336f357f01e1c0a5061214ab7d18133c1b
Stats:     144 lines in 2 files changed: 143 ins; 0 del; 1 mod

8277093: Vector should throw ClassNotFoundException for a missing class of an element

Reviewed-by: smarks

-------------

PR: https://git.openjdk.java.net/jdk17u/pull/279


More information about the jdk-updates-dev mailing list