On Wed, 11 Mar 2026 06:10:38 GMT, Tejesh R <[email protected]> wrote:
> On macosx-aarch64 system, mouse cursor is also captured on screen capture.
> Fix is to reset the mouse position before screen capture (some minor code
> warning removed with the fix). Several iterations passed in CI.
LGTM apart from minor code cleanup suggestions.
test/jdk/javax/swing/JTable/8236907/LastVisibleRow.java line 62:
> 60: Point clkPoint;
> 61: try {
> 62: testRobot = new Robot();
The following can be set in the beginning to avoid adding delays after each
robot action.
testRobot.setAutoWaitForIdle(true);
testRobot.setAutoDelay(30);
test/jdk/javax/swing/JTable/8236907/LastVisibleRow.java line 63:
> 61: try {
> 62: testRobot = new Robot();
> 63: SwingUtilities.invokeAndWait((Runnable)
> LastVisibleRow::createAndShowGUI);
Runnable can be removed here and at other locations.
Suggestion:
SwingUtilities.invokeAndWait(LastVisibleRow::createAndShowGUI);
test/jdk/javax/swing/JTable/8236907/LastVisibleRow.java line 75:
> 73: resetMousePos();
> 74: testRobot.delay(1000);
> 75: testRobot.waitForIdle();
A delay of 1s seems unnecessary after mouse move. Can be removed if auto delay
is set in the beginning.
test/jdk/javax/swing/JTable/8236907/LastVisibleRow.java line 139:
> 137:
> 138: private static void resetMousePos() {
> 139: testRobot.mouseMove(5, 5);
It maybe a good idea to move it slightly farther from the edge
Suggestion:
testRobot.mouseMove(50, 50);
test/jdk/javax/swing/JTable/8236907/LastVisibleRow.java line 168:
> 166: captureRect[0] = new Rectangle(point.x+5, point.y+2,
> 167: table.getColumnCount() * cellRect.width - 10,
> 168: cellRect.height-2);
Suggestion:
captureRect[0] = new Rectangle(point.x + 5, point.y + 2,
table.getColumnCount() * cellRect.width - 10,
cellRect.height - 2);
-------------
Marked as reviewed by honkar (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/30177#pullrequestreview-3932107381
PR Review Comment: https://git.openjdk.org/jdk/pull/30177#discussion_r2920637815
PR Review Comment: https://git.openjdk.org/jdk/pull/30177#discussion_r2920658321
PR Review Comment: https://git.openjdk.org/jdk/pull/30177#discussion_r2920641571
PR Review Comment: https://git.openjdk.org/jdk/pull/30177#discussion_r2920599322
PR Review Comment: https://git.openjdk.org/jdk/pull/30177#discussion_r2920651000