Skip to content

Conversation

@rajamah
Copy link
Member

@rajamah rajamah commented Apr 2, 2025

Details:
Refactored code as requested in the Bug description.

Tested and verified the test passes.


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-8351884: Refactor bug8033699.java test code (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 24384

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 2, 2025

👋 Welcome back rmahajan! 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
Copy link

openjdk bot commented Apr 2, 2025

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

8351884: Refactor bug8033699.java test  code

Reviewed-by: aivanov, honkar, dmarkov

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 master branch:

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 /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot changed the title 8351884: Refactor bug8033699.java test code 8351884: Refactor bug8033699.java test code Apr 2, 2025
@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 2, 2025
@openjdk
Copy link

openjdk bot commented Apr 2, 2025

@rajamah 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 Apr 2, 2025
@mlbridge
Copy link

mlbridge bot commented Apr 2, 2025

@rajamah
Copy link
Member Author

rajamah commented Apr 15, 2025

Can someone please review this? , it has been more than 10 days that it has been out there.

Thank you!

Copy link
Contributor

@honkar-jdk honkar-jdk left a 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) ?

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 15, 2025
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.

Overall, it looks good to me.

Except for the minor comments that I left, I can suggest:

  • removing System.out.println before 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;
Copy link
Member

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.

Comment on lines 71 to 74
SwingUtilities.invokeAndWait(() -> {
focusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
});

Copy link
Member

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;
Copy link
Member

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.

Copy link
Member

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.

@aivanov-jdk
Copy link
Member

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?

@kumarabhi006
Copy link
Contributor

#23964 (comment)

Will take a look soon.

@kumarabhi006
Copy link
Contributor

kumarabhi006 commented Apr 18, 2025

#23964 (comment)

Will take a look soon.

I took a look today and it looks good to me.
I agree with @aivanov-jdk suggestions. Adding print statements are redundant.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Apr 22, 2025
@rajamah
Copy link
Member Author

rajamah commented Apr 22, 2025

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) ?

Yes, it looks good on multiple runs.

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, except for minor nits.

Comment on lines 61 to 62
robot = new Robot();

SwingUtilities.invokeAndWait(() -> {
Copy link
Member

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.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 25, 2025
rajamah and others added 2 commits April 25, 2025 12:47
Co-authored-by: Alexey Ivanov <alexey.ivanov@oracle.com>
Co-authored-by: Alexey Ivanov <alexey.ivanov@oracle.com>
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Apr 25, 2025
rajamah and others added 3 commits April 25, 2025 12:48
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>
rajamah and others added 2 commits April 25, 2025 13:05
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.

Remove the unused import. Otherwise, looks good to me.


import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.BoxLayout;
Copy link
Member

Choose a reason for hiding this comment

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

Now, BoxLayout is unused.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 28, 2025
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Apr 28, 2025
@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 28, 2025
@rajamah
Copy link
Member Author

rajamah commented Apr 28, 2025

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Apr 28, 2025
@openjdk
Copy link

openjdk bot commented Apr 28, 2025

@rajamah
Your change (at version c0ad289) is now ready to be sponsored by a Committer.

@aivanov-jdk
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Apr 30, 2025

Going to push as commit 482538b.
Since your change was applied there have been 764 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Apr 30, 2025
@openjdk openjdk bot closed this Apr 30, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Apr 30, 2025
@openjdk
Copy link

openjdk bot commented Apr 30, 2025

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

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

Development

Successfully merging this pull request may close these issues.

5 participants