8224105: Cannot parse JapaneseDate string on some specified locales

Reviewed-by: bchristi
This commit is contained in:
Naoto Sato 2019-05-21 13:40:56 -07:00
parent 94619467c8
commit 8f1d837e99
2 changed files with 25 additions and 2 deletions

View file

@ -257,11 +257,13 @@ public class CalendarNameProviderImpl extends CalendarNameProvider implements Av
return langtags;
}
// Check if each string is unique, except null or empty strings,
// as these strings are used for keys in the name-to-value map.
private boolean hasDuplicates(String[] strings) {
int len = strings.length;
for (int i = 0; i < len - 1; i++) {
String a = strings[i];
if (a != null) {
if (a != null && !a.isEmpty()) {
for (int j = i + 1; j < len; j++) {
if (a.equals(strings[j])) {
return true;