Skip to content
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

8303440: The "ZonedDateTime.parse" may not accept the "UTC+XX" zone id #12868

Closed
wants to merge 3 commits into from

Conversation

naotoj
Copy link
Member

@naotoj naotoj commented Mar 3, 2023

This change is to fix a regression caused by the fix to JDK-8234347. The previous fix was simply disabling offset-based parsing if the parser was text-based. Instead, check if it is an offset or not by explicitly comparing the character with '+'/'-' and continue offset parsing if it is.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8303440: The "ZonedDateTime.parse" may not accept the "UTC+XX" zone id

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/12868/head:pull/12868
$ git checkout pull/12868

Update a local copy of the PR:
$ git checkout pull/12868
$ git pull https://git.openjdk.org/jdk pull/12868/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 12868

View PR using the GUI difftool:
$ git pr show -t 12868

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/12868.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 3, 2023

👋 Welcome back naoto! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 3, 2023
@openjdk
Copy link

openjdk bot commented Mar 3, 2023

@naotoj The following labels will be automatically applied to this pull request:

  • core-libs
  • i18n

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added core-libs core-libs-dev@openjdk.org i18n i18n-dev@openjdk.org labels Mar 3, 2023
@mlbridge
Copy link

mlbridge bot commented Mar 3, 2023

Webrevs

@openjdk
Copy link

openjdk bot commented Mar 4, 2023

@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:

8303440: The "ZonedDateTime.parse" may not accept the "UTC+XX" zone id

Reviewed-by: iris, jpai, rriggs, lancea

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 50 new commits pushed to the master branch:

  • a97271e: 8301793: AlgorithmId should not encode a missing parameters field as NULL unless hardcoded
  • cac81dd: 8303577: [JVMCI] OOME causes crash while translating exceptions
  • 877ab65: 8303264: Refactor nsk/stress/strace to extract shared and remove redundant code
  • ae8730f: 8303486: [REDO] Update ProcessTools.startProcess(...) to exit early if process exit before linePredicate is printed.
  • 5977f26: 8303604: Passing by-value structs whose size is not power of 2 doesn't work on all platforms (mainline)
  • dccfe8a: 8303582: Reduce duplication in jdk/java/foreign tests
  • 8e20145: 8300654: Remove JVMFlag::flag_error_str as it is unused
  • bdffe46: 8301222: Generalize check_release_entry in OopStorage
  • ec4e8aa: 8303244: G1: call CardTable::clear_MemRegion directly
  • 5753ab5: 8297454: javax/swing/JComponent/7154030/bug7154030.java failed with "Exception: Failed to show opaque button"
  • ... and 40 more: https://git.openjdk.org/jdk/compare/0b6355794101bda9de623016ce88f8abbb314f63...master

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 4, 2023
* @test
* @modules jdk.localedata
* @bug 8303440
* @summary Test parsing "UTC-XX:XX" text works correctly
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Naoto, I haven't tried it, but without a @run testng instruction, does jtreg have the ability to auto infer this as a testng testcase?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review, Jai!
The default test behavior under java/time directory is defined in java/time/test/TEST.properties file, where it directs they are run using TestNG.

static {
// Assuming CLDR's SHORT name for "America/Los_Angeles"
// produces "UTC\u212208:00"
System.setProperty("java.locale.providers", "CLDR");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this updates a system property (that's recognized by code even outside of this test), perhaps we should use @run testng/othervm to prevent interfering with other tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the TEST.properties directs tests to be run under othervm mode.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Naoto for that detail, I wasn't aware of it.

@Test
public void testUTCShortNameRoundTrip() {
var fmt = DateTimeFormatter.ofPattern("z", Locale.FRANCE);
var now = ZonedDateTime.of(2023, 3, 3, 0, 0, 0, 0, ZoneId.of("America/Los_Angeles"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, this is no longer now. Should it renamed to avoid confusion?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Modified.

Copy link
Contributor

@RogerRiggs RogerRiggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@naotoj
Copy link
Member Author

naotoj commented Mar 6, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Mar 6, 2023

Going to push as commit cfb0a25.
Since your change was applied there have been 50 commits pushed to the master branch:

  • a97271e: 8301793: AlgorithmId should not encode a missing parameters field as NULL unless hardcoded
  • cac81dd: 8303577: [JVMCI] OOME causes crash while translating exceptions
  • 877ab65: 8303264: Refactor nsk/stress/strace to extract shared and remove redundant code
  • ae8730f: 8303486: [REDO] Update ProcessTools.startProcess(...) to exit early if process exit before linePredicate is printed.
  • 5977f26: 8303604: Passing by-value structs whose size is not power of 2 doesn't work on all platforms (mainline)
  • dccfe8a: 8303582: Reduce duplication in jdk/java/foreign tests
  • 8e20145: 8300654: Remove JVMFlag::flag_error_str as it is unused
  • bdffe46: 8301222: Generalize check_release_entry in OopStorage
  • ec4e8aa: 8303244: G1: call CardTable::clear_MemRegion directly
  • 5753ab5: 8297454: javax/swing/JComponent/7154030/bug7154030.java failed with "Exception: Failed to show opaque button"
  • ... and 40 more: https://git.openjdk.org/jdk/compare/0b6355794101bda9de623016ce88f8abbb314f63...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Mar 6, 2023
@openjdk openjdk bot closed this Mar 6, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Mar 6, 2023
@openjdk
Copy link

openjdk bot commented Mar 6, 2023

@naotoj Pushed as commit cfb0a25.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org i18n i18n-dev@openjdk.org integrated Pull request has been integrated
5 participants