RFR: JDK-8321545: Override toString() for Format subclasses [v4]

Justin Lu jlu at openjdk.org
Mon Jan 22 22:54:26 UTC 2024


On Fri, 12 Jan 2024 21:30:05 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Justin Lu 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 eight additional commits since the last revision:
>> 
>>  - replace 'None' with 'null' for applicable classes
>>  - Merge branch 'master' into JDK-8321545-toString-j.text.Format
>>  - swap placement of decimal pattern and compact patterns. Expand on tests
>>  - add unit tests
>>  - Merge branch 'master' into JDK-8321545-toString-j.text.Format
>>  - account for null locale for SDF through deserialization
>>  - Merge branch 'master' into JDK-8321545-toString-j.text.Format
>>  - init
>
> src/java.base/share/classes/java/text/MessageFormat.java line 1195:
> 
>> 1193:             """
>> 1194:             MessageFormat [locale: "%s", pattern: "%s"]
>> 1195:             """.formatted(locale == null ? "null" : locale.getDisplayName(), toPattern());
> 
> It would be more accurate if when locale ==null that null was not quoted in the string.
> Seeing "null" would imply that the displayName of the locale was "null", when it was `null`.

Hi Roger, addressed in https://github.com/openjdk/jdk/pull/17355/commits/70e0a175037ccd0215d76fb2fbfa8c91de291d41; would like to confirm the update is okay with you before integration.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17355#discussion_r1462516181


More information about the core-libs-dev mailing list