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

8273491: java.util.spi.LocaleServiceProvider spec contains statement that is too strict #5457

Closed
wants to merge 2 commits into from

Conversation

naotoj
Copy link
Member

@naotoj naotoj commented Sep 9, 2021

Small spec clarification. Corresponding CSR has also been drafted.


Progress

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

Issue

  • JDK-8273491: java.util.spi.LocaleServiceProvider spec contains statement that is too strict

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5457

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

Using diff file

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

@naotoj
Copy link
Member Author

naotoj commented Sep 9, 2021

/csr

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 9, 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 rfr Pull request is ready for review csr Pull request needs approved CSR before integration labels Sep 9, 2021
@openjdk
Copy link

openjdk bot commented Sep 9, 2021

@naotoj this pull request will not be integrated until the CSR request JDK-8273577 for issue JDK-8273491 has been approved.

@openjdk
Copy link

openjdk bot commented Sep 9, 2021

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

  • core-libs

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

@openjdk openjdk bot added the core-libs core-libs-dev@openjdk.org label Sep 9, 2021
@mlbridge
Copy link

mlbridge bot commented Sep 9, 2021

Webrevs

@naotoj
Copy link
Member Author

naotoj commented Sep 10, 2021

/label i18n

@openjdk openjdk bot added the i18n i18n-dev@openjdk.org label Sep 10, 2021
@openjdk
Copy link

openjdk bot commented Sep 10, 2021

@naotoj
The i18n label was successfully added.

* affect the order.
* the locale sensitive services separated by a comma. It is only read and cached at
* the initialization of this class, so the later call to
* {@link System#setProperty(String, String)} may not affect the order.
Copy link
Member

@JoeWang-Java JoeWang-Java Sep 10, 2021

Choose a reason for hiding this comment

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

I wonder if we can be clearer as "may not" implies uncertainty. While it indeed may or may not work due to the timing of the initialization of this class, my understanding of the above statement is that it implied the runtime startup is recommended as it provides assurance. Would it be better to put that in the statement? sth. like: It is read once and cached at the Java runtime startup or initialization of this class. A call after the initialization of this class will not affect the order.

Copy link
Member Author

@naotoj naotoj Sep 10, 2021

Choose a reason for hiding this comment

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

It was intentional to use may not because as you said, there's still uncertainty. To clarify it more, I added wording that setProperty use is discouraged to change the preferred order.

Copy link
Contributor

@LanceAndersen LanceAndersen Sep 11, 2021

Choose a reason for hiding this comment

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

Hi Naoto,

A couple of questions:

  • Are there any scenarios where invoking setProperty will not override the command line setting ?
  • Did you consider an @ImplNote for your clarification given the behavior "might" be different in other implementations (I am not sure myself) and is implementation defined?

Best
Lance

Copy link
Member

@JoeWang-Java JoeWang-Java Sep 10, 2021

Choose a reason for hiding this comment

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

That sounds good to me, suggesting doing it at launch while discouraging the use of setProperty.

Copy link
Member Author

@naotoj naotoj Sep 11, 2021

Choose a reason for hiding this comment

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

Hi Lance,

  • Are there any scenarios where invoking setProperty will not override the command line setting ?

Yes. For example, if a logger is installed, it formats the log date/time which causes initialization of locale-related classes before the app's main() method invocation, resulting setProperty() having no effect.

  • Did you consider an @ImplNote for your clarification given the behavior "might" be different in other implementations (I am not sure myself) and is implementation defined?

As in the above example, the behavior changes regardless of the implementation of the runtime. The clarification is mainly for the API consumer, rather than platform implementors.

Hope this answers your questions.

Copy link
Contributor

@LanceAndersen LanceAndersen Sep 11, 2021

Choose a reason for hiding this comment

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

Hi Naoto,

Thank you for the clarification. Yes it makes sense.

Best
Lance

@openjdk openjdk bot removed the csr Pull request needs approved CSR before integration label Sep 14, 2021
@openjdk
Copy link

openjdk bot commented Sep 14, 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:

8273491: java.util.spi.LocaleServiceProvider spec contains statement that is too strict

Reviewed-by: joehw, 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 38 new commits pushed to the master branch:

  • c54a918: 8273691: Missing comma after 2021 in GraphemeTestAccessor.java copyright notice
  • 3d9dc8f: 8273430: Suspicious duplicate condition in java.util.regex.Grapheme#isExcludedSpacingMark
  • 5095068: 8273675: Remove unused Universe::_verify_in_progress flag
  • fc0f854: 8246797: A convenient method to read OPTIONAL element
  • 6cf5079: 8273513: Make java.io.FilterInputStream specification more precise about overrides
  • b4b1210: 8273616: Fix trivial doc typos in the java.base module
  • 7c26ddb: 8195809: [TESTBUG] jps and jcmd -l support for containers is not tested
  • 4cfa230: 8273259: Character.getName doesn't follow Unicode spec for ideographs
  • f9b2507: 8271834: TestStringDeduplicationAgeThreshold intermittent failures on Shenandoah
  • 261cb44: 8273629: compiler/uncommontrap/TestDeoptOOM.java fails with release VMs
  • ... and 28 more: https://git.openjdk.java.net/jdk/compare/54dee132d1a149165e7478b29b740d086c18c424...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 Sep 14, 2021
@naotoj
Copy link
Member Author

naotoj commented Sep 14, 2021

/integrate

@openjdk
Copy link

openjdk bot commented Sep 14, 2021

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

  • ed7789d: 8256977: Bump minimum GCC from 5.x to 6 for JDK
  • 5bfd043: 8273497: building.md should link to both md and html
  • 3884580: 8273597: Rectify Thread::is_ConcurrentGC_thread()
  • f527289: 8273639: tests fail with "assert(_handle_mark_nesting > 1) failed: memory leak: allocating handle outside HandleMark"
  • 1d2458d: 8266550: C2: mirror TypeOopPtr/TypeInstPtr/TypeAryPtr with TypeKlassPtr/TypeInstKlassPtr/TypeAryKlassPtr
  • a143372: 8273438: Enable parallelism in vmTestbase/metaspace/stressHierarchy tests
  • 86a8e55: 8273486: Zero: Handle DiagnoseSyncOnValueBasedClasses VM option
  • 8d73ee6: 8273471: Add foldmultilines to UL for stdout/err
  • c54a918: 8273691: Missing comma after 2021 in GraphemeTestAccessor.java copyright notice
  • 3d9dc8f: 8273430: Suspicious duplicate condition in java.util.regex.Grapheme#isExcludedSpacingMark
  • ... and 36 more: https://git.openjdk.java.net/jdk/compare/54dee132d1a149165e7478b29b740d086c18c424...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Sep 14, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 14, 2021
@openjdk
Copy link

openjdk bot commented Sep 14, 2021

@naotoj Pushed as commit 31667da.

💡 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
3 participants