-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8351884: Refactor bug8033699.java test code #24384
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 rmahajan! A progress list of the required criteria for merging this PR into |
|
@rajamah 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 730 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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@honkar-jdk, @dmarkov20, @aivanov-jdk) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
Webrevs
|
|
Can someone please review this? , it has been more than 10 days that it has been out there. Thank you! |
honkar-jdk
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 apart from minor inline suggestion.
Since the test has lot of tab movements, does CI testing look good on all platforms on multiple runs (repeat) ?
aivanov-jdk
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.
Overall, it looks good to me.
Except for the minor comments that I left, I can suggest:
- removing
System.out.printlnbefore throwing an error — it adds no value, the error message from the exception is sufficient; - removing "as expected" from the error message which is implied because it's an error.
| import java.awt.event.KeyEvent; | ||
|
|
||
| import javax.swing.BorderFactory; |
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'd rather preserve the blank line between java.* and javax.* packages. However, the list of imports isn't too long in either block.
| SwingUtilities.invokeAndWait(() -> { | ||
| focusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager(); | ||
| }); | ||
|
|
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.
Storing the focusManager once before calling testLaF for the first time is enough.
|
|
||
| private static boolean actRB1 = false; | ||
| private static boolean actRB2 = false; | ||
| private static boolean actRB3 = false; |
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.
These three boolean variables need to be declared volatile, the value is modified on the EDT but their value is read on the main thread.
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.
You can replace them with CountDownLatches, but it looks like an overkill in this case, moreover hitKey automatically invokes robot.waitForIdle.
|
For the sake of completeness, the description could've mentioned that @kumarabhi006 requested these changes in #23964 (comment). Abhishek, could you review the updated test code? |
Will take a look soon. |
I took a look today and it looks good to me. |
Yes, it looks good on multiple runs. |
aivanov-jdk
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.
Looks good to me, except for minor nits.
| robot = new Robot(); | ||
|
|
||
| SwingUtilities.invokeAndWait(() -> { |
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 wonder why you removed the blank line, I'm strongly for restoring it here.
Co-authored-by: Alexey Ivanov <alexey.ivanov@oracle.com>
Co-authored-by: Alexey Ivanov <alexey.ivanov@oracle.com>
Co-authored-by: Alexey Ivanov <alexey.ivanov@oracle.com>
Co-authored-by: Alexey Ivanov <alexey.ivanov@oracle.com>
Co-authored-by: Alexey Ivanov <alexey.ivanov@oracle.com>
Co-authored-by: Alexey Ivanov <alexey.ivanov@oracle.com>
aivanov-jdk
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.
Remove the unused import. Otherwise, looks good to me.
|
|
||
| import javax.swing.BorderFactory; | ||
| import javax.swing.Box; | ||
| import javax.swing.BoxLayout; |
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.
Now, BoxLayout is unused.
|
/integrate |
|
/sponsor |
|
Going to push as commit 482538b.
Your commit was automatically rebased without conflicts. |
|
@aivanov-jdk @rajamah Pushed as commit 482538b. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Details:
Refactored code as requested in the Bug description.
Tested and verified the test passes.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/24384/head:pull/24384$ git checkout pull/24384Update a local copy of the PR:
$ git checkout pull/24384$ git pull https://git.openjdk.org/jdk.git pull/24384/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 24384View PR using the GUI difftool:
$ git pr show -t 24384Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/24384.diff
Using Webrev
Link to Webrev Comment