Integrated: JDK-8281462: Annotation toString output for enum not reusable for source input

Joe Darcy darcy at openjdk.java.net
Fri Feb 11 23:28:12 UTC 2022


On Thu, 10 Feb 2022 05:49:47 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

This pull request has now been integrated.

Changeset: c3179a87
Author:    Joe Darcy <darcy at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/c3179a8760019b5954e344bf0d2775e1e1968f32
Stats:     80 lines in 8 files changed: 25 ins; 6 del; 49 mod

8281462: Annotation toString output for enum not reusable for source input

Reviewed-by: mchung

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

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


More information about the core-libs-dev mailing list