Skip to content

8339791: Refactor MiscUndecorated/ActiveAWTWindowTest.java#26471

Closed
srmandal wants to merge 7 commits intoopenjdk:masterfrom
srmandal:8339791
Closed

8339791: Refactor MiscUndecorated/ActiveAWTWindowTest.java#26471
srmandal wants to merge 7 commits intoopenjdk:masterfrom
srmandal:8339791

Conversation

@srmandal
Copy link
Copy Markdown

@srmandal srmandal commented Jul 25, 2025

The java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java test uses object monitors and wait/notify to synchronise actions in the test.

Using CountDownLatch could make the test simpler, shorter, clearer.
Tested the code on a windows-x64, macos-x64 and lnux-x64 machines and the test is working as expected.


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-8339791: Refactor MiscUndecorated/ActiveAWTWindowTest.java (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 26471

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper bot commented Jul 25, 2025

👋 Welcome back smandalika! 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
Copy Markdown

openjdk bot commented Jul 25, 2025

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

8339791: Refactor MiscUndecorated/ActiveAWTWindowTest.java

Reviewed-by: psadhukhan

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 1132 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 (@kumarabhi006, @prsadhuk) 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 added the rfr Pull request is ready for review label Jul 25, 2025
@openjdk
Copy link
Copy Markdown

openjdk bot commented Jul 25, 2025

@srmandal 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 25, 2025
@mlbridge
Copy link
Copy Markdown

mlbridge bot commented Jul 25, 2025

Webrevs

@srmandal
Copy link
Copy Markdown
Author

Can someone take a quick look and provide feedback on this simple refactoring change ?

Comment thread test/jdk/java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java Outdated
Copy link
Copy Markdown
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.

Few more observations :

  1. Add a space wherever application. At L76... try {
  2. Don't think it is required to print stack trace, you can throw it in RTE.
  3. At L165, robot.waitForIdle(5 * delay);
  4. Access UI components on EDT. e.g L166 etc.
  5. Can remove //captureScreenAndSave(); and System.err.println("Test failed!"); lines

Comment thread test/jdk/java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java Outdated
Comment thread test/jdk/java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java Outdated
Comment thread test/jdk/java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java
@srmandal
Copy link
Copy Markdown
Author

All Comments have been incorporated.

  1. Replaced ExtendedRobot by Robot
  2. focusGainLatch usage fixed with an appropriate countDown
  3. Replaced Delay*N with actual values.
  4. Removed printStackTrace.
  5. UI components access restricted to EDT fixed, both initiatiliseGUI, doTest are now static.
  6. @OverRide added
  7. Also the frame.toFront is now removed, as there is already a mouse click on the frame in the code, which is more reliable and has same effect - for the test scenario.

@srmandal
Copy link
Copy Markdown
Author

srmandal commented Sep 2, 2025

I have incorporated the review suggestions. Can anyone provide feedback on these?

Comment thread test/jdk/java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java Outdated
Comment thread test/jdk/java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java Outdated
Comment thread test/jdk/java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java Outdated
Comment thread test/jdk/java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java Outdated
Comment thread test/jdk/java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java Outdated
@srmandal
Copy link
Copy Markdown
Author

srmandal commented Sep 4, 2025

Changed as suggested. All redudant RTEs were removed.

Comment thread test/jdk/java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java Outdated
Comment thread test/jdk/java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java Outdated
Comment thread test/jdk/java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java Outdated
@srmandal
Copy link
Copy Markdown
Author

Removed the passed & eventType variable for test pass/fail assertion.
Tweaked to assert test scenario only on based on latch.
Removed boiler plate code for mouse Move & Click.

I have incorporated the review suggestions. Can anyone provide feedback on these?

@lawrence-andrew
Copy link
Copy Markdown
Contributor

LGTM

Comment thread test/jdk/java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java Outdated
Comment thread test/jdk/java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java
@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 16, 2025
@srmandal
Copy link
Copy Markdown
Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Sep 16, 2025
@openjdk
Copy link
Copy Markdown

openjdk bot commented Sep 16, 2025

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

@srmandal
Copy link
Copy Markdown
Author

Can some one please sponsor this PR.

@prsadhuk
Copy link
Copy Markdown
Contributor

/sponsor

@openjdk
Copy link
Copy Markdown

openjdk bot commented Sep 18, 2025

Going to push as commit a306f88.
Since your change was applied there have been 1176 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 Sep 18, 2025
@openjdk openjdk bot closed this Sep 18, 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 Sep 18, 2025
@openjdk
Copy link
Copy Markdown

openjdk bot commented Sep 18, 2025

@prsadhuk @srmandal Pushed as commit a306f88.

💡 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