Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8262108: SimpleDateFormat formatting broken for sq_MK Locale #3463

Closed
wants to merge 10 commits into from
Expand Up @@ -190,7 +190,8 @@ private Map<String, Integer> getDisplayNamesImpl(String calendarType, int field,
continue;
}
if (field == AM_PM && !javatime && i > PM) {
// when dealing with calendar fields, don't set AM_PM field value
// Unlike in the case of java.time.format.DateTimeFormatter(Builder),
// when dealing with java.util.Calendar, don't set AM_PM field value
// to anything that isn't either AM or PM (this can happen when
// day periods are involved)
continue;
Expand Down
1 change: 0 additions & 1 deletion test/jdk/java/util/Calendar/CalendarDisplayNamesTest.java
Expand Up @@ -50,7 +50,6 @@ public void testAM_PMDisplayNameValues() {
for (final Locale locale : Locale.getAvailableLocales()) {
for (final int style : styles) {
final Calendar cal = Calendar.getInstance();
cal.setLenient(false);
final Map<String, Integer> names = cal.getDisplayNames(Calendar.AM_PM, style, locale);
if (names == null) {
continue;
Expand Down
10 changes: 4 additions & 6 deletions test/jdk/java/util/Calendar/NarrowNamesTest.java
Expand Up @@ -111,12 +111,10 @@ public static void main(String[] args) {
expectedFieldValues.put("n", null);
testAM_PM(US, ALL_STYLES, expectedFieldValues);
} else {
Map<String, Integer> expectedFieldValues = new HashMap<>();
expectedFieldValues.put("AM", Calendar.AM);
expectedFieldValues.put("PM", Calendar.PM);
expectedFieldValues.put("a", Calendar.AM);
expectedFieldValues.put("p", Calendar.PM);
testAM_PM(US, ALL_STYLES, expectedFieldValues);
testMap(US, AM_PM, ALL_STYLES,
"AM", "PM",
RESET_INDEX,
"a", "p");
}
testMap(JAJPJP, DAY_OF_WEEK, NARROW_STANDALONE,
"", // 1-based indexing for DAY_OF_WEEK
Expand Down