[jdk20] RFR: 4958969: ObjectOutputStream example leads to non-working code

Lance Andersen lancea at openjdk.org
Mon Dec 19 20:25:51 UTC 2022


On Mon, 19 Dec 2022 20:12:15 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

> Update javadoc examples to use try-with-resources and use javadoc snippet tags.
> The examples in ObjectInputStream and ObjectOutputStream get an update with
> try-with-resources and use of javadoc snippet tags.
> ObjectInputFilter is updated with use of snippet tags instead of html markup.

Looks good Roger,  one trivial suggestion to consider below

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

> 124:  *         String label = (String) ois.readObject();
> 125:  *         LocalDateTime date = (LocalDateTime) ois.readObject();
> 126:  *         System.out.println(label + ": " + date);

would it be worth using `System.out.printf` here?

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

Marked as reviewed by lancea (Reviewer).

PR: https://git.openjdk.org/jdk20/pull/59


More information about the core-libs-dev mailing list