On Wed, 29 Apr 2026 18:38:50 GMT, Justin Lu <[email protected]> wrote:

>> Enabling customization of localized format patterns for the `java.time` 
>> date/time formatters through the locale-sensitive SPI. While existing SPIs 
>> allow customization of textual elements, such as month-of-year names, 
>> formatting patterns (e.g., "dd/MM/yyyy") cannot currently be customized for 
>> a given locale.
>> 
>> This enhancement is needed to support customers migrating from the 
>> now-removed COMPAT locale resources to CLDR-based ones.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> 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`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/30979#discussion_r3163373877

Reply via email to