RFR: 8344841: ClassPrinter prints confusing value for null

Adam Sotona asotona at openjdk.org
Fri Nov 22 10:28:25 UTC 2024


ClassPrinter prints `null` values as `String` "null" or as `String.valueOf(ConstantDescs.BSM_NULL_CONSTANT)`, based on context.

This patch unifies handling of `null` values.
They are now exclusively represented as `ConstantDescs.BSM_NULL_CONSTANT`.
In Json and Yaml format is `null` value printed unquoted and in Xml as `<null/>`.
In Json and Yaml is `"null"` `String` printed quoted to distinguish from the `null` value.

Please review.

Thank you,
Adam

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

Commit messages:
 - 8344841: ClassPrinter prints confusing value for null

Changes: https://git.openjdk.org/jdk/pull/22316/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22316&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8344841
  Stats: 30 lines in 2 files changed: 18 ins; 0 del; 12 mod
  Patch: https://git.openjdk.org/jdk/pull/22316.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22316/head:pull/22316

PR: https://git.openjdk.org/jdk/pull/22316


More information about the core-libs-dev mailing list