RFR: 8150564: Migrate useful ExtendedRobot methods into awt.Robot [v9]

Chen Liang liach at openjdk.org
Tue Oct 7 23:30:51 UTC 2025


On Thu, 25 Sep 2025 00:25:25 GMT, Damon Nguyen <dnguyen at openjdk.org> wrote:

>> Some useful methods (click, glide, waitForIdle, type) in ExtendedRobot should be migrated into Robot itself so that ExtendedRobot can be removed in the future. The tests using these ExtendedRobot methods will be handled separately.
>
> Damon Nguyen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove synchronized keyword

src/java.desktop/share/classes/java/awt/Robot.java line 133:

> 131:      * {@link #glide(int, int, int, int) glide},
> 132:      * {@link #type(int) type}, and
> 133:      * {@link #click(int) click}

Suggestion:

     * {@link #click(int) click}.

src/java.desktop/share/classes/java/awt/Robot.java line 800:

> 798:      * @throws  IllegalArgumentException if the {@code buttons} mask contains the mask for
> 799:      *          extra mouse button and support for extended mouse buttons is
> 800:      *          {@link Toolkit#areExtraMouseButtonsEnabled() disabled} by Java

Suggestion:

     *          {@linkplain Toolkit#areExtraMouseButtonsEnabled() disabled} by Java

`{@link}` renders in `{@code}` font.

src/java.desktop/share/classes/java/awt/Robot.java line 803:

> 801:      * @throws  IllegalArgumentException if the {@code buttons} mask contains the mask for
> 802:      *          extra mouse button that does not exist on the mouse and support for extended
> 803:      *          mouse buttons is {@link Toolkit#areExtraMouseButtonsEnabled() enabled}

Suggestion:

     *          mouse buttons is {@linkplain Toolkit#areExtraMouseButtonsEnabled() enabled}

src/java.desktop/share/classes/java/awt/Robot.java line 988:

> 986:      * A convenience method that simulates typing a char by calling {@code keyPress}
> 987:      * and {@code keyRelease}. Gets the ExtendedKeyCode for the char and calls
> 988:      * type(int keycode).

Suggestion:

     * {@link #type(int) type(int keycode)}.

Or
Suggestion:

     * {@code type(int keycode)}.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26969#discussion_r2410968044
PR Review Comment: https://git.openjdk.org/jdk/pull/26969#discussion_r2410969799
PR Review Comment: https://git.openjdk.org/jdk/pull/26969#discussion_r2410970561
PR Review Comment: https://git.openjdk.org/jdk/pull/26969#discussion_r2412161667


More information about the client-libs-dev mailing list