RFR: 8307934 JRobot.moveMouseTo must access component on EDT [v3]

Renjith Kannath Pariyangad duke at openjdk.org
Tue Jun 27 11:50:03 UTC 2023


On Wed, 21 Jun 2023 10:36:08 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> 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.
>
>> 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.
> 
> Stale result may lead to a test failure because robot moved mouse to an incorrect location.
> 
> I submitted this bug after I noticed it in a code review. It might have been the reason why that test failed intermittently. That test was rewritten without using `JRobot` if my memory serves me right.
> 
>> And nothing in the AWT docs say you need to do this.
> 
> AWT docs don't say AWT is thread-safe either, at least explicitly.
> 
> Yet this case is for Swing components where the docs always say Swing is not thread-safe. The `JRobot` class is `test/jdk/javax/swing/regtesthelpers/` which implies it's used for testing Swing.

Thank you @aivanov-jdk for the review, I have sorted imports and updated java docs.

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

PR Comment: https://git.openjdk.org/jdk/pull/14354#issuecomment-1609339241



More information about the client-libs-dev mailing list