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

Mandy Chung mchung at openjdk.java.net
Fri Feb 11 22:55:05 UTC 2022


On Fri, 11 Feb 2022 20:34:43 GMT, Joe Darcy <darcy at openjdk.org> wrote:

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

Looks good to me.

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

Marked as reviewed by mchung (Reviewer).

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


More information about the core-libs-dev mailing list