RFR: 8150564: Migrate useful ExtendedRobot methods into awt.Robot [v30]
Alexander Zvegintsev
azvegint at openjdk.org
Thu Aug 7 17:25:42 UTC 2025
On Thu, 7 Aug 2025 16:10:06 GMT, Alisen Chung <achung at openjdk.org> wrote:
>> Some useful methods in ExtendedRobot should be migrated into Robot itself so that ExtendedRobot can be removed in the future. The tests using ExtendedRobot for these migrated methods are changed to use only Robot (removing unnecessary building of ExtendedRobot).
>
> Alisen Chung has updated the pull request incrementally with one additional commit since the last revision:
>
> update robot spec
test/jdk/java/awt/datatransfer/Independence/IndependenceSwingTest.java line 29:
> 27: * @requires (os.family == "linux")
> 28: * @summary To make sure that System & Primary clipboards should behave independently
> 29: * @library /lib/client
Suggestion:
Many tests still use `@library /lib/client`.
Not only are they unnecessary in most cases, but they can also hide the use of `ExtendedRobot`.
For example, in this test, the use of `ExtendedRobot` has not been removed, and it is implicitly compiled due to the presence of `@library /lib/client`. After removing `@library`, the test no longer compiles.
error: cannot find symbol
private static ExtendedRobot robot;
I suggest removing all unnecessary uses of `@library/lib/client` because there are still plenty of uses of `ExtendedRobot` in other tests as well.
This issue has been [raised](https://github.com/openjdk/jdk/pull/22044#discussion_r2140831788) before, but it has not yet been resolved for all tests.
---
Also, please run a grep search for `ExtendedRobot` in the `test/jdk` directory. This pull request does not cover many tests that still use the `ExtendedRobot` (which doesn't even use the `dragAndDrop()` and can be safely removed).
test/jdk/lib/client/ExtendedRobot.java line 158:
> 156: * @see #dragAndDrop(int, int, int, int)
> 157: */
> 158: public void dragAndDrop(Point from, Point to){
I missed that earlier. Why didn't we also move the `dragAndDrop` methods to `java.awt.Robot`?
This would allow us to remove the ExtendedRobot class entirely.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22044#discussion_r2260904871
PR Review Comment: https://git.openjdk.org/jdk/pull/22044#discussion_r2260964661
More information about the client-libs-dev
mailing list