RFR: 8276665: ObjectInputStream.GetField.get(name, object) should throw ClassNotFoundException

Naoto Sato naoto at openjdk.java.net
Wed Nov 17 18:43:39 UTC 2021


On Mon, 15 Nov 2021 17:28:30 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

> The ObjectInputStream.GetField.get(String name, Object val) method is returning null instead of throwing an exception when the class of the object is not found. The caller is not able to correctly handle the case where the class is not found. The signature of GetField.get(name, val) should have a throws ClassNotFoundException and a ClassNotFoundException exception should be thrown.

Look good.

src/java.base/share/classes/java/io/ObjectInputStream.java line 304:

> 302:          * {@link ClassNotFoundException} to {@code null}. If set to {@code true}
> 303:          * {@link GetField#get(String, Object)} returns null otherwise
> 304:          * throwing @link ClassNotFoundException}.

'{' is missing before `@link`.

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

PR: https://git.openjdk.java.net/jdk/pull/6393


More information about the core-libs-dev mailing list