mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8303440: The "ZonedDateTime.parse" may not accept the "UTC+XX" zone id
Reviewed-by: iris, jpai, rriggs, lancea
This commit is contained in:
parent
a97271e3b5
commit
cfb0a25a4e
2 changed files with 81 additions and 2 deletions
|
@ -4666,8 +4666,10 @@ public final class DateTimeFormatterBuilder {
|
|||
if (length >= position + 3 && context.charEquals(text.charAt(position + 2), 'C')) {
|
||||
// There are localized zone texts that start with "UTC", e.g.
|
||||
// "UTC\u221210:00" (MINUS SIGN instead of HYPHEN-MINUS) in French.
|
||||
// Exclude those ZoneText cases.
|
||||
if (!(this instanceof ZoneTextPrinterParser)) {
|
||||
// Exclude those cases.
|
||||
if (length == position + 3 ||
|
||||
context.charEquals(text.charAt(position + 3), '+') ||
|
||||
context.charEquals(text.charAt(position + 3), '-')) {
|
||||
return parseOffsetBased(context, text, position, position + 3, OffsetIdPrinterParser.INSTANCE_ID_ZERO);
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue