RFR: 8307934 JRobot.moveMouseTo must access component on EDT

Phil Race prr at openjdk.org
Thu Jun 15 23:00:00 UTC 2023


On Wed, 7 Jun 2023 12:54:54 GMT, Renjith Kannath Pariyangad <duke at openjdk.org> wrote:

> Hi Reviewers,
> 
> I have updated the JRobot.java file for enabling EDT support, along with I have removed warning BUTTON1_MASK with 'BUTTON1_DOWN_MASK'.
> 
> Regards,
> Renjith

I still quibble with the premise of this bug.
No exceptions or any nasty stuff will happen if you don't use the EDT to call getSize().
It is more a case of you may get stale results.

And nothing in the AWT docs say you need to do this.

test/jdk/javax/swing/regtesthelpers/JRobot.java line 171:

> 169:      */
> 170:     public void clickMouse() {
> 171:         clickMouse(InputEvent.BUTTON1_DOWN_MASK);

Note that this is a different int value than the old MASK constant so it is important that you ran all tests (which you say you did) in case some test is not consistently using the Robot API and will end up mixing old and new which will likely cause failures.

-------------

PR Review: https://git.openjdk.org/jdk/pull/14354#pullrequestreview-1482490422
PR Review Comment: https://git.openjdk.org/jdk/pull/14354#discussion_r1231606693



More information about the client-libs-dev mailing list