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

8275721: Name of UTC timezone in a locale changes depending on previous code #6709

Closed
wants to merge 4 commits into from

Conversation

naotoj
Copy link
Member

@naotoj naotoj commented Dec 3, 2021

Fixing time zone name provider for CLDR. In some cases, COMPAT's UTC display names were incorrectly substituted for CLDR. The reason it worked fine after zh-Hant-HK was that by loading names for zh-Hant-HK, the names for zh-Hant were cached and hit for the following zh-MO name retrieval.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8275721: Name of UTC timezone in a locale changes depending on previous code

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6709/head:pull/6709
$ git checkout pull/6709

Update a local copy of the PR:
$ git checkout pull/6709
$ git pull https://git.openjdk.java.net/jdk pull/6709/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6709

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6709.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Dec 3, 2021

👋 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 label Dec 4, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Dec 4, 2021

@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 i18n labels Dec 4, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Dec 4, 2021

Webrevs

@@ -28,6 +28,7 @@
import static sun.util.locale.provider.LocaleProviderAdapter.Type;

import java.text.MessageFormat;
import java.time.ZoneId;
Copy link
Member

@JoeWang-Java JoeWang-Java Dec 6, 2021

Choose a reason for hiding this comment

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

nit, the import is not used?

Copy link
Member Author

@naotoj naotoj Dec 6, 2021

Choose a reason for hiding this comment

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

Right. Removed.

}

@Test(dataProvider="locales")
public void test_ChineseTimeZoneNames(Locale testLoc, Locale resourceLoc) {
Copy link
Member

@JoeWang-Java JoeWang-Java Dec 6, 2021

Choose a reason for hiding this comment

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

Does this test exercise the problem as in the original test? Do we need a test to reproduce the calling sequence as the original test?

The original issue seems to me was that the names were dependent on the order of calls, due to the name being cached. That is, if utcNameIn("zh-Hant-HK") is called first, subsequent call utcNameIn("zh-MO") would get the cached name from the call (zh-Hant-HK), but if the later is called first, it would not have the problem, that is, the following would return a correct name (協調世界時間):
utcNameIn("zh-MO"); utcNameIn("zh-Hant-HK"); utcNameIn("zh-MO");

Copy link
Member Author

@naotoj naotoj Dec 6, 2021

Choose a reason for hiding this comment

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

協調世界時間 is actually coming from COMPAT provider, which is wrong. The expected name 世界標準時間 in CLDR is in zh-Hant resource bundle which is not available in COMPAT provider. Thus, comparing zh-MO and zh-Hant names effectively asserts that the name is correctly coming from CLDR provider. I confirmed that this regression test did fail with the runtime without the proposed fix.

@openjdk
Copy link

@openjdk openjdk bot commented Dec 6, 2021

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

8275721: Name of UTC timezone in a locale changes depending on previous code

Reviewed-by: joehw

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

  • ea8d3c9: 8271566: DSA signature length value is not accurate in P11Signature
  • 239362d: 8247973: Javadoc incorrect for IdentityArrayList, IdentityLinkedList
  • 2c31a17: 8275082: Update XML Security for Java to 2.3.0
  • 70bad89: 8277497: Last column cell in the JTAble row is read as empty cell
  • 5045eb5: 8278273: Remove unnecessary exclusion of doclint accessibility checks
  • 587e540: 8210558: serviceability/sa/TestJhsdbJstackLock.java fails to find '^\s+- waiting to lock <0x[0-9a-f]+> (a java.lang.Class ...'
  • 082fdf4: 8172065: javax/swing/JTree/4908142/bug4908142.java The selected index should be "aad"
  • ab78187: 8277105: Inconsistent handling of missing permitted subclasses
  • adf3952: 8277372: Add getters for BOT and card table members
  • 7c6f57f: 8275610: C2: Object field load floats above its null check resulting in a segfault
  • ... and 75 more: https://git.openjdk.java.net/jdk/compare/51d6d7a36b760b2b2b77269cc06438108a9931a2...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 label Dec 6, 2021
@naotoj
Copy link
Member Author

@naotoj naotoj commented Dec 7, 2021

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Dec 7, 2021

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

  • bd7c54a: 8278341: Liveness check for global scope is not as fast as it could be
  • c609b5d: 8277628: Spec for InetAddressResolverProvider::get() throwing error or exception could be clearer
  • bb50b92: 8277536: Use String.blank in jdk.javadoc where applicable
  • 5b81d5e: 8276901: Implement UseHeavyMonitors consistently
  • 69d8669: 8278339: ServerSocket::isClosed may return false after accept throws
  • 56ca66e: 8277863: Deprecate sun.misc.Unsafe methods that return offsets
  • 3536127: 8277383: VM.metaspace optionally show chunk freelist details
  • 44fcee3: 8278289: Drop G1BlockOffsetTablePart::_object_can_span
  • b2638e5: 8244602: Add JTREG_REPEAT_COUNT to repeat execution of a test
  • 07669e3: 8275375: [REDO] JDK-8271949 dumppath in -XX:FlightRecorderOptions does not affect
  • ... and 91 more: https://git.openjdk.java.net/jdk/compare/51d6d7a36b760b2b2b77269cc06438108a9931a2...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Dec 7, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Dec 7, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Dec 7, 2021

@naotoj Pushed as commit 543d1a8.

💡 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 i18n integrated
2 participants