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

Alisen Chung achung at openjdk.org
Thu Aug 7 23:04:23 UTC 2025


On Thu, 7 Aug 2025 20:54:59 GMT, Alexander Zvegintsev <azvegint at openjdk.org> wrote:

>> When I ran tests earlier to see which ExtendedRobot methods were used previously i found that dragAndDrop was never used by any tests, so I decided not to migrate it. It might be better to just remove it all outright and I might do that in a followup PR to remove ExtendedRobot entirely (along with moving the rest of the tests using ER)
>
>>  i found that dragAndDrop was never used by any tests
> 
> This doesn't seem to be true. I see several tests using it:
> 
> 
> ./java/awt/Window/ShapedAndTranslucentWindows/StaticallyShaped.java:73:        robot.dragAndDrop(location.x + dl, location.y + 5, location.x + dl + random.nextInt(dl), location.y + random.nextInt(dl));
> ./java/awt/Window/ShapedAndTranslucentWindows/StaticallyShaped.java:79:        robot.dragAndDrop(location.x + 4, location.y + 4, location.x + random.nextInt(2*dl)-dl, location.y + random.nextInt(2*dl)-dl);
> ./java/awt/Window/ShapedAndTranslucentWindows/ShapedTranslucent.java:75:        robot.dragAndDrop(location.x + dl, location.y + 5, location.x + dl + random.nextInt(dl), location.y + random.nextInt(dl));
> ./java/awt/Window/ShapedAndTranslucentWindows/ShapedTranslucent.java:81:        robot.dragAndDrop(location.x + 4, location.y + 4, location.x + random.nextInt(2*dl)-dl, location.y + random.nextInt(2*dl)-dl);
> ./java/awt/Window/ShapedAndTranslucentWindows/Translucent.java:72:        robot.dragAndDrop(location.x + dl, location.y + 5, location.x + dl + random.nextInt(dl), location.y + random.nextInt(dl));
> ./java/awt/Window/ShapedAndTranslucentWindows/Translucent.java:78:        robot.dragAndDrop(location.x + 4, location.y + 4, location.x + random.nextInt(2*dl)-dl, location.y + random.nextInt(2*dl)-dl);
> ./java/awt/Window/ShapedAndTranslucentWindows/Shaped.java:75:        robot.dragAndDrop(location.x + dl, location.y + 5, location.x + dl + random.nextInt(dl), location.y + random.nextInt(dl));
> ./java/awt/Window/ShapedAndTranslucentWindows/Shaped.java:81:        robot.dragAndDrop(location.x + 4, location.y + 4, location.x + random.nextInt(2*dl)-dl, location.y + random.nextInt(2*dl)-dl);
> ./java/awt/Window/ShapedAndTranslucentWindows/ShapedTranslucentWindowClick.java:174:        robot.dragAndDrop(MouseInfo.getPointerInfo().getLocation(), new Point(x+5, y));
> ./java/awt/event/MouseEvent/DragToLightweightTest.java:79:        robot.dragAndDrop(
> ./javax/swing/JWindow/ShapedAndTranslucentWindows/Common.java:369:        robot.dragAndDrop(location.x + 30, location.y + 5, location.x + dl + random.nextInt(dl), location.y + random.nextInt(dl));
> ./javax/swing/JWindow/ShapedAndTranslucentWindows/Common.java:375:        robot.dragAndDrop(location.x + 4, location.y + 4, location.x + random.nextInt(2*dl)-dl, location.y + random.nextInt(2*dl)-dl);
> ./javax/swing/JWindow/ShapedAndTranslucentWindows/Common.java:387:        robot.dragAndDrop(location.x + 30, location.y + ...

I've migrated dragAndDrop(int, int, int, int) and updated the csr to include the migration. Can you take a look at the specification to see if it meets the standard?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22044#discussion_r2261604905


More information about the client-libs-dev mailing list