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

Roger Riggs rriggs at openjdk.java.net
Thu Nov 18 15:33:26 UTC 2021


> 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.

Roger Riggs has updated the pull request incrementally with three additional commits since the last revision:

 - Merge branch '8276665-readfields-cnfe' of https://github.com/RogerRiggs/jdk into 8276665-readfields-cnfe
 - Correct javadoc link syntax
 - 8276665: ObjectInputStream.GetField.get should throw ClassNotFoundException
   Updated to add throws CNFE to GetField.get and test for various cases.

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/6393/files
  - new: https://git.openjdk.java.net/jdk/pull/6393/files/dab6150f..085b3deb

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=6393&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=6393&range=00-01

  Stats: 2 lines in 2 files changed: 0 ins; 1 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6393.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6393/head:pull/6393

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


More information about the core-libs-dev mailing list