RFR: 8345144: Robot does not specify all causes of IllegalThreadStateException [v3]
Phil Race
prr at openjdk.org
Wed Dec 18 22:34:40 UTC 2024
On Wed, 11 Dec 2024 19:40:51 GMT, Alisen Chung <achung at openjdk.org> wrote:
>> When robot.autoWaitForIdle is set to true, all mouse and key-related methods when invoked on the EDT will throw java.lang.IllegalThreadStateException which is not in the Robot specification.
>>
>> This PR updates the specification by adding warnings to avoid calling lengthy and delay-type methods on EDT and including exceptions thrown when autoWaitForIdle is set to true and mouse/key-handling methods are called on the EDT.
>
> Alisen Chung has updated the pull request incrementally with two additional commits since the last revision:
>
> - align spacing
> - remove extra space
src/java.desktop/share/classes/java/awt/Robot.java line 61:
> 59: * the mouse cursor instead of just generating mouse move events.
> 60: * <p>
> 61: * Note: {@code waitForIdle()} must not be called on the AWT EDT, since
The word "and" needs to be before "since" for this to make sense and then that needs more rewording later.
Mulling it over, I suggest rewording like this
<pre>
* Note: When {@code autoWaitForIdle()} is enabled, mouse and key related methods
* cannot be called on the AWT EDT.
* This is because when {@code autoWaitForIdle()} is enabled,
* the mouse and key methods implicitly call {@code waitForIdle()}
* which will throw {@code IllegalThreadStateException} when called on the AWT EDT.
</pre>
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22564#discussion_r1890911896
More information about the client-libs-dev
mailing list