On Wed, 29 Apr 2026 18:43:45 GMT, Justin Lu <[email protected]> wrote:
>> src/java.base/macosx/classes/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java
>> line 176:
>>
>>> 174: public String getDateTimeFormatterPattern(String
>>> requestedTemplate, String calType, Locale locale) {
>>> 175: // Not supported. Return the requestedTemplate as is.
>>> 176: return requestedTemplate;
>>
>> I think this introduces a behavioral change and is not ideal behavior.
>> Before, the default implementation threw `DateTimeException` for these
>> methods. However, in the new HOST code we are returning the pattern as is.
>> Thus, users who invoke methods that delegate to this code will silently
>> succeed with non-supported patterns.
>
> For example, with a HOST only provider, code that called
> `DateTimeFormatterBuilder.getLocalizedDateTimePattern` will now silently
> return the pattern as is, instead of failing with the expected
> `DateTimeException`.
That was initially intended. I thought it would help returning at least the
requested components. On second thought, it may not be so useful for end users,
as it includes no delimiters and order is somewhat odd. Changed it to throw the
exeption as before.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/30979#discussion_r3164339593