RFR: JDK-8281462: Annotation toString output for enum not reusable for source input [v3]

Joe Darcy darcy at openjdk.java.net
Fri Feb 11 20:34:43 UTC 2022


> Two changes to the toString output for annotations to give better source fidelity:
> 
> 1) For enum constants, call their name method rather than their toString method. An enum class can override the toString method to print something other than the name.
> 
> 2) Switch from using binary names (names with "$" for nested types) to canonical names (names with "." with nested types)
> 
> Various existing regression tests are updated to accommodate the changes.
> 
> Please also review the CSR:
> https://bugs.openjdk.java.net/browse/JDK-8281568

Joe Darcy has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:

 - Respond to more review feedback.
 - Merge branch 'master' into JDK-8281462
 - Respond to review feedback.
 - JDK-8281462: Annotation toString output for enum not reusable for source input

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/7418/files
  - new: https://git.openjdk.java.net/jdk/pull/7418/files/2989ff11..0af92ea9

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

  Stats: 3897 lines in 70 files changed: 2865 ins; 435 del; 597 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7418.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7418/head:pull/7418

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


More information about the core-libs-dev mailing list