8177819: DateTimeFormatterBuilder zone parsing should recognise DST

8277049: ZonedDateTime parse in Fall DST transition fails to retain the correct zonename.

Reviewed-by: joehw, scolebourne
This commit is contained in:
Naoto Sato 2021-12-01 17:14:53 +00:00
parent 9b3e672059
commit a363b7b921
5 changed files with 121 additions and 130 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -417,6 +417,24 @@ final class DateTimeParseContext {
currentParsed().zone = zone;
}
/**
* Stores the parsed zone name type.
* <p>
* This stores the zone name type that has been parsed.
* The parsed type should either be;
* <ul>
* <li>{@link DateTimeFormatterBuilder.ZoneTextPrinterParser#UNDEFINED}</li>
* <li>{@link DateTimeFormatterBuilder.ZoneTextPrinterParser#STD}</li>
* <li>{@link DateTimeFormatterBuilder.ZoneTextPrinterParser#DST}</li>
* <li>{@link DateTimeFormatterBuilder.ZoneTextPrinterParser#GENERIC}</li>
* </ul>
*
* @param type the parsed zone name type
*/
void setParsedZoneNameType(int type) {
currentParsed().zoneNameType = type;
}
/**
* Stores the parsed leap second.
*/