-
Bug
-
Resolution: Fixed
-
P3
-
15
-
b08
-
generic
-
generic
-
Not verified
A DESCRIPTION OF THE PROBLEM :
Hi.
In your latest jdk15 versions, we found something not quite right.
a related pr is at https://github.com/apache/commons-lang/pull/558
In short, some codes like this cannot pass tests for some Locale like "ff_LR_#Adlm"
BUT in jdk 8-14's all locales can pass the tests, only ones newlly added in jdk15 fails.
I wanna know whether it be by design or just a bug.
REGRESSION : Last worked in version 14.0.1
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the tests below with Junit.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
tests pass
ACTUAL -
tests failed
---------- BEGIN SOURCE ----------
@Test
public void java15BuggyLocaleTestAll() throws ParseException {
for (final Locale locale : Locale.getAvailableLocales()) {
testSingleLocale(locale);
}
}
@Test
public void java15BuggyLocaleTest() throws ParseException {
final String buggyLocaleName = "ff_LR_#Adlm";
Locale buggyLocale = null;
for (final Locale locale : Locale.getAvailableLocales()) {
if (buggyLocaleName.equals(locale.toString())) {
buggyLocale = locale;
break;
}
}
if (buggyLocale == null) {
return;
}
testSingleLocale(buggyLocale);
}
private void testSingleLocale(Locale locale) throws ParseException {
final Calendar cal = Calendar.getInstance(GMT);
cal.clear();
cal.set(2003, Calendar.FEBRUARY, 10);
final SimpleDateFormat sdf = new SimpleDateFormat(LONG_FORMAT, locale);
final String formattedDate = sdf.format(cal.getTime());
sdf.parse(formattedDate);
sdf.parse(formattedDate.toUpperCase(locale));
sdf.parse(formattedDate.toLowerCase(locale));
}
---------- END SOURCE ----------
FREQUENCY : always
Hi.
In your latest jdk15 versions, we found something not quite right.
a related pr is at https://github.com/apache/commons-lang/pull/558
In short, some codes like this cannot pass tests for some Locale like "ff_LR_#Adlm"
BUT in jdk 8-14's all locales can pass the tests, only ones newlly added in jdk15 fails.
I wanna know whether it be by design or just a bug.
REGRESSION : Last worked in version 14.0.1
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the tests below with Junit.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
tests pass
ACTUAL -
tests failed
---------- BEGIN SOURCE ----------
@Test
public void java15BuggyLocaleTestAll() throws ParseException {
for (final Locale locale : Locale.getAvailableLocales()) {
testSingleLocale(locale);
}
}
@Test
public void java15BuggyLocaleTest() throws ParseException {
final String buggyLocaleName = "ff_LR_#Adlm";
Locale buggyLocale = null;
for (final Locale locale : Locale.getAvailableLocales()) {
if (buggyLocaleName.equals(locale.toString())) {
buggyLocale = locale;
break;
}
}
if (buggyLocale == null) {
return;
}
testSingleLocale(buggyLocale);
}
private void testSingleLocale(Locale locale) throws ParseException {
final Calendar cal = Calendar.getInstance(GMT);
cal.clear();
cal.set(2003, Calendar.FEBRUARY, 10);
final SimpleDateFormat sdf = new SimpleDateFormat(LONG_FORMAT, locale);
final String formattedDate = sdf.format(cal.getTime());
sdf.parse(formattedDate);
sdf.parse(formattedDate.toUpperCase(locale));
sdf.parse(formattedDate.toLowerCase(locale));
}
---------- END SOURCE ----------
FREQUENCY : always
- csr for
-
JDK-8248516 some newly added locale cannot parse uppercased date string.
-
- Closed
-
- relates to
-
JDK-8248655 Support supplementary characters in String case insensitive operations
-
- Resolved
-