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

8312075: FileChooser.win32.newFolder is not updated when changing Locale #15069

Closed
wants to merge 8 commits into from

Conversation

TejeshR13
Copy link
Contributor

@TejeshR13 TejeshR13 commented Jul 28, 2023

On NewFolderAction, plain String is added Action.ACTION_COMMAND_KEY. Converting the String to locale before adding as command key fix the issue.
I have verified the test in all other platforms and Look and Feel which has option to create New Folder, results were fine. No regressions found on CI system with the fix. Added manual test to verify the fix.


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-8312075: FileChooser.win32.newFolder is not updated when changing Locale (Bug - P3)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 15069

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 28, 2023

👋 Welcome back tr! 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 Jul 28, 2023
@openjdk
Copy link

openjdk bot commented Jul 28, 2023

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

  • client

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 client client-libs-dev@openjdk.org label Jul 28, 2023
@mlbridge
Copy link

mlbridge bot commented Jul 28, 2023

@TejeshR13
Copy link
Contributor Author

Closing the PR based on discussion and better understanding of the bug along with locale support provided.

@TejeshR13 TejeshR13 closed this Aug 8, 2023
@TejeshR13 TejeshR13 reopened this Aug 9, 2023
@TejeshR13
Copy link
Contributor Author

Re-opening the PR with proposed fix. After understanding the issue reported and analysis made, it is observed that on change of locale (mid-application) all others component labels were update with new locale provided, yet New Folder didn't. So if changing Locale mid-application is accepted, then updating the two fields newFolderString and newFolderNextString in WindowsFileSystemView class is required. (Yet other OS classes to be updated too)

@aivanov-jdk
Copy link
Member

Re-opening the PR with proposed fix. After understanding the issue reported and analysis made, it is observed that on change of locale (mid-application) all others component labels were update with new locale provided, yet New Folder didn't. So if changing Locale mid-application is accepted, then updating the two fields newFolderString and newFolderNextString in WindowsFileSystemView class is required. (Yet other OS classes to be updated too)

I think the user would expect that if they change a string in UIManager, that string is used.

So, previously, the translations for "New Folder" couldn't be changed after FileSystemView is initialised. Now it uses whatever string is in UIManager when a new folder is created.

With this in mind, the test case could simply put new values to UIManager after JFileChooser is created and verify that new folders created using the UI that the file chooser provides use the new strings.

Yet other OS classes to be updated too

Then you should update them.

@TejeshR13
Copy link
Contributor Author

Yeah, much better. Ill update the test too.

Copy link
Member

@aivanov-jdk aivanov-jdk left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@openjdk
Copy link

openjdk bot commented Sep 1, 2023

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

8312075: FileChooser.win32.newFolder is not updated when changing Locale

Reviewed-by: aivanov, abhiscxk

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

  • 75d4ac2: 8311775: [TEST] duplicate verifyHeapDump in several tests
  • 4f90aba: 8311585: Add JRadioButtonMenuItem to bug8031573.java
  • 2a11bc4: 8314837: 5 compiled/codecache tests ignore VM flags
  • 2f7c65e: 8303427: Fixpath confused if unix root contains "/jdk"
  • e9e0c56: 8314319: LogCompilation doesn't reset lateInlining when it encounters a failure.
  • 56b8db1: 8258970: Disabled JPasswordField foreground color is wrong with GTK LAF
  • 0d4cadb: 8315195: RISC-V: Update hwprobe query for new extensions
  • b4f7069: 8315446: G1: Remove unused G1AllocRegion::attempt_allocation
  • cf02cf3: 8315098: Improve URLEncodeDecode microbenchmark
  • c32e340: 8315321: [aix] os::attempt_reserve_memory_at must map at the requested address or fail
  • ... and 404 more: https://git.openjdk.org/jdk/compare/86821a7ce89c51cc3650228c55a4a88c743209e4...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 1, 2023
Copy link
Contributor

@kumarabhi006 kumarabhi006 left a comment

Choose a reason for hiding this comment

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

Test verified, looks good to me.

@TejeshR13
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Sep 8, 2023

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

  • 806ef08: 8315594: Open source few headless Swing misc tests
  • 4b43c25: 8310929: Optimization for Integer.toString
  • 111ecdb: 8268829: Provide an optimized way to walk the stack with Class object only
  • 716201c: 8314935: Shenandoah: Unable to throw OOME on back-to-back Full GCs
  • 4c6d7fc: 8315795: runtime/Safepoint/TestAbortVMOnSafepointTimeout.java fails after JDK-8305507
  • 7e7ab6e: 8315877: ProblemList vmTestbase/nsk/jvmti/InterruptThread/intrpthrd003/TestDescription.java on macosx-aarch64
  • 0c865a7: 8315637: JDK-8314249 broke libgraal
  • 683672c: 8292692: Move MethodCounters inline functions out of method.hpp
  • 9bf3dee: 8314831: NMT tests ignore vm flags
  • b74805d: 8315863: [GHA] Update checkout action to use v4
  • ... and 471 more: https://git.openjdk.org/jdk/compare/86821a7ce89c51cc3650228c55a4a88c743209e4...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Sep 8, 2023

@TejeshR13 Pushed as commit 3a00ec8.

💡 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
client client-libs-dev@openjdk.org integrated Pull request has been integrated
4 participants