<i18n dev> RFR: 8177819: DateTimeFormatterBuilder zone parsing should recognise DST [v2]

Naoto Sato naoto at openjdk.java.net
Wed Nov 24 23:25:25 UTC 2021


On Wed, 24 Nov 2021 21:27:15 GMT, Joe Wang <joehw at openjdk.org> wrote:

>> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Refined wording
>
> src/java.base/share/classes/java/time/format/DateTimeFormatter.java line 509:
> 
>> 507:  * parsed from the zone name that does not imply daylight saving time, then
>> 508:  * {@link ChronoZonedDateTime#withLaterOffsetAtOverlap()} is issued
>> 509:  * to use the standard offset at the overlap, before forming the instant.
> 
> Is the standard offset the subject instead of the withLaterOffsetAtOverlap method? Calling the method seems to be an impl detail to me. We might rephrase the sentence to sth. like:
> If the {@code ZoneId} parsed does not indicate daylight saving time, the standard offset will be used at the local time-line overlap as specified in the {@link ChronoZonedDateTime#withLaterOffsetAtOverlap()} method to form the instant.

Removed the method, and made `standard offset` the subject of the sentence.

> src/java.base/share/classes/java/time/format/Parsed.java line 139:
> 
>> 137:      * The parsed zone name type.
>> 138:      */
>> 139:     int zoneNameType = -1;
> 
> Could be an Enum if that helps with readability.

Since the index needs some calculation, I left it as `int`. Changed to use the constant fields for better readability.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6527


More information about the i18n-dev mailing list