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
8177819: DateTimeFormatterBuilder zone parsing should recognise DST #6527
Conversation
8277049: ZonedDateTime parse in Fall DST transition fails to retain the correct zonename.
/csr |
👋 Welcome back naoto! A progress list of the required criteria for merging this PR into |
/issue add JDK-8277049 |
@naotoj this pull request will not be integrated until the CSR request JDK-8277607 for issue JDK-8177819 has been approved. |
@naotoj |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the compatibility assessment, it looks like an incompatible change since apps that expect DST will get a different offset at the overlap. The risk is low, perhaps because of the rare use case? That additional explanation might be helpful.
* of {@link ChronoLocalDateTime#atZone(ZoneId)}. If the {@code ZoneId} was | ||
* parsed from the zone name that does not imply daylight saving time, then | ||
* {@link ChronoZonedDateTime#withLaterOffsetAtOverlap()} is issued | ||
* to use the standard offset at the overlap, before forming the instant. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the method, and made standard offset
the subject of the sentence.
/** | ||
* The parsed zone name type. | ||
*/ | ||
int zoneNameType = -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be an Enum if that helps with readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the index needs some calculation, I left it as int
. Changed to use the constant fields for better readability.
Thanks, Joe. Refined the wording in the compatibility assessment in the CSR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Naoto. The change Look good to me.
@@ -4897,13 +4903,13 @@ protected boolean prefixOf(CharSequence text, int off, int end) { | |||
*/ | |||
private static class LENIENT extends CI { | |||
|
|||
private LENIENT(String k, String v, PrefixTree child) { | |||
super(k, v, child); | |||
private LENIENT(String k, String v, int t, PrefixTree child) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is class LENIENT
actually in use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
* of {@link ChronoLocalDateTime#atZone(ZoneId)}. | ||
* of {@link ChronoLocalDateTime#atZone(ZoneId)}. If the {@code ZoneId} was | ||
* parsed from the zone name that does not indicate daylight saving time, then | ||
* the standard offset will be used at the local time-line overlap. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As written, I would read it as being the generic zone name that gets altered, rather than a zone name that explicitly indicates "winter" time. maybe:
"If the {@code ZoneId} was parsed from a zone name that indicates whether daylight saving time in in operation or not, then that fact will be used to select the correct offset at the local time-line overlap."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified as suggested.
@naotoj This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 93 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
/integrate |
Going to push as commit a363b7b.
Your commit was automatically rebased without conflicts. |
This fix intends to honor the type (std/dst/generic) of parsed zone name for selecting the offset at the overlap. Corresponding CSR has also been drafted.
Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6527/head:pull/6527
$ git checkout pull/6527
Update a local copy of the PR:
$ git checkout pull/6527
$ git pull https://git.openjdk.java.net/jdk pull/6527/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 6527
View PR using the GUI difftool:
$ git pr show -t 6527
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6527.diff