LANG-1669: Fixed issue with parsing certain locales using day periods introduced in OpenJDK 16 and later resolved in OpenJDK 17 (#791)

This commit is contained in:
Andrew Thomas 2021-08-19 06:10:56 -07:00 committed by GitHub
parent a6df7f7456
commit 03edee7451
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -756,7 +756,10 @@ public class FastDateParser implements DateParser, Serializable {
// match missing the optional trailing period
iVal = lKeyValues.get(lowerCase + '.');
}
calendar.set(field, iVal.intValue());
//LANG-1669: Mimic fix done in OpenJDK 17 to resolve issue with parsing newly supported day periods added in OpenJDK 16
if (Calendar.AM_PM != this.field || iVal <= 1) {
calendar.set(field, iVal.intValue());
}
}
/**