From 65abf24fde6432fb386a616bbadc5689975c3bf4 Mon Sep 17 00:00:00 2001 From: Naoto Sato Date: Fri, 10 May 2024 16:10:40 +0000 Subject: [PATCH] 8331866: Add warnings for locale data dependence Reviewed-by: jlu, srl, joehw --- .../share/classes/java/util/spi/LocaleServiceProvider.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/java.base/share/classes/java/util/spi/LocaleServiceProvider.java b/src/java.base/share/classes/java/util/spi/LocaleServiceProvider.java index 2bf0c711cfe..6ec8b2a149a 100644 --- a/src/java.base/share/classes/java/util/spi/LocaleServiceProvider.java +++ b/src/java.base/share/classes/java/util/spi/LocaleServiceProvider.java @@ -152,6 +152,11 @@ import java.util.Locale; * supported by the Java runtime environment. The following table lists the * version of CLDR used in each JDK release. Unless otherwise specified, all * update releases in a given JDK release family use the same CLDR version. + * Note that the CLDR locale data are subject to change. Users should not assume + * that the locale data remain the same across CLDR versions. Otherwise, unexpected + * incompatible behaviors may occur, such as an exception on parsing a date. + * Refer to CLDR Releases + * for the deltas between their releases. * * * @@ -264,7 +269,7 @@ public abstract class LocaleServiceProvider { for (Locale available : getAvailableLocales()) { if (locale.equals(available.stripExtensions())) { return true; -} + } } return false; }
JDK releases and supported CLDR versions