On Thu, 3 Feb 2022 23:29:54 GMT, Naoto Sato <na...@openjdk.org> wrote:

> Following the prior discussion [1], here is the PR for the subject 
> enhancement. CSR has also been updated according to the suggestion.
> 
> [1] 
> https://mail.openjdk.java.net/pipermail/core-libs-dev/2022-January/085175.html

src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java line 
254:

> 252:     public static String getLocalizedDateTimePattern(String 
> requestedTemplate,
> 253:                                                      Chronology chrono, 
> Locale locale) {
> 254:         Objects.requireNonNull(locale, "requestedTemplate");

Typo, "locale" should have been requestedTemplate.

src/java.base/share/classes/sun/util/locale/provider/JavaTimeDateTimePatternImpl.java
 line 77:

> 75:         LocaleProviderAdapter lpa = 
> LocaleProviderAdapter.getResourceBundleBased();
> 76:         // CLDR's 'u'/'U' are not supported in the JDK. Replace them with 
> 'y' instead
> 77:         final var modifiedSkeleton = requestedTemplate.replaceAll("[uU]", 
> "y");

Seems to me requestedTemplate needs to be validated when it gets passed to 
getLocalizedDateTimePattern,  similar as to appendLocalized

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

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

Reply via email to