< prev index next >
src/java.base/share/classes/sun/util/locale/provider/CalendarNameProviderImpl.java
Print this page
rev 52979 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: TBD
*** 115,125 ****
return null;
}
}
name = strings[value];
// If name is empty in standalone, try its `format' style.
! if (name.length() == 0
&& (style == SHORT_STANDALONE || style == LONG_STANDALONE
|| style == NARROW_STANDALONE)) {
name = getDisplayName(calendarType, field, value,
getBaseStyle(style),
locale);
--- 115,125 ----
return null;
}
}
name = strings[value];
// If name is empty in standalone, try its `format' style.
! if (name.isEmpty()
&& (style == SHORT_STANDALONE || style == LONG_STANDALONE
|| style == NARROW_STANDALONE)) {
name = getDisplayName(calendarType, field, value,
getBaseStyle(style),
locale);
*** 181,191 ****
int base = (field == DAY_OF_WEEK) ? 1 : 0;
for (int i = 0; i < strings.length; i++) {
String name = strings[i];
// Ignore any empty string (some standalone month names
// are not defined)
! if (name.length() == 0) {
continue;
}
map.put(name, base + i);
}
}
--- 181,191 ----
int base = (field == DAY_OF_WEEK) ? 1 : 0;
for (int i = 0; i < strings.length; i++) {
String name = strings[i];
// Ignore any empty string (some standalone month names
// are not defined)
! if (name.isEmpty()) {
continue;
}
map.put(name, base + i);
}
}
< prev index next >