-
Notifications
You must be signed in to change notification settings - Fork 6.2k
JDK-8371365 : Update javax/swing/JFileChooser/bug4759934.java to use Util.findComponent() #28169
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
Conversation
|
👋 Welcome back honkar! A progress list of the required criteria for merging this PR into |
|
@honkar-jdk 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 38 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 |
|
@aivanov-jdk @TejeshR13 Please review |
|
@honkar-jdk The following label will be automatically applied to this pull request:
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. |
Webrevs
|
| @@ -72,8 +74,10 @@ public static void main(String[] args) throws Exception { | |||
| robot.mouseRelease(MouseEvent.BUTTON1_DOWN_MASK); | |||
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.
All the clicks above are to click a button… Should we replace these clicks with programmatic clicks?
This is more reliable and quicker than robot.
The only possible issue is to to ensure the updated test still reproduces the original bug.
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.
I just noticed your comment: #27944 (comment)
I'm for keeping the other clicks as-is (via Robot) since we have reference to these buttons unlike the cancel button of JFileChooser and this way keep much of the original test case intact without overly modifying it.
“…Since we have reference to these buttons,” it's even easier to call frameBtn.doClick() and dlgBtnLoc.doClick().
Once you get the reference to the Cancel button in the file chooser you can also use robot to click the button.
Using consistently the same method to click the buttons makes the test easier to comprehend.
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.
I referred to the original JBS issue for which this test was created - JDK-4759934. Looks like we can use doClick() instead of using Robot for the clicks.
But the problem is that when we use doClick() for frameBtn and dialogBtn, JFC's click on Cancel button doesn't happen and the test fails due to timeout. This happens on macOS26, I have to test on other platforms.
SwingUtilities.invokeAndWait(() -> frameBtn.doClick());
robot.waitForIdle();
robot.delay(500);
SwingUtilities.invokeAndWait(() -> dialogBtn.doClick());
robot.waitForIdle();
robot.delay(500);
SwingUtilities.invokeAndWait(() -> {
JButton cancelBtn = findCancelButton(jfc);
cancelBtn.doClick();
});
robot.delay(500);
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.
I see… It may be not worth the effort then.
However, this behaviour — clicking the Cancel button doesn't happen — could be a bug.
Why does the test time out? Even if clicking the Cancel button didn't work, the test should finish with a failure.
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.
I believe the test hangs after - dialogBtn.doClick() and does not proceed to the test condition check. I'll need to check in depth as to why this is happening.
I see… It may be not worth the effort then.
I can create a separate JBS issue to look into it and as for the test changes use the doClick() for just the JFC's Cancel button. Does this sound good to you?
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.
Does this sound good to you?
This is likely the best approach.
It's a new problem that we discovered. It doesn't prevent integrating the change to search for the Cancel button in the file chooser, yet it would be good to investigate what goes wrong when all the buttons are clicked programmatically instead of using the robot to generate mouse clicks.
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.
Created a new JBS to track the doClick() issue - JDK-8371728
DamonGuy
left a comment
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.
LGTM. Seems like this will be more consistent and reads better. Tested and passes.
|
/integrate |
|
Going to push as commit 78db38f.
Your commit was automatically rebased without conflicts. |
|
@honkar-jdk Pushed as commit 78db38f. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
/javax/swing/JFileChooser/bug4759934.java test changes related to addition of new method to Util - #27944.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28169/head:pull/28169$ git checkout pull/28169Update a local copy of the PR:
$ git checkout pull/28169$ git pull https://git.openjdk.org/jdk.git pull/28169/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28169View PR using the GUI difftool:
$ git pr show -t 28169Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28169.diff
Using Webrev
Link to Webrev Comment