RFR: 8328560: java/awt/event/MouseEvent/ClickDuringKeypress/ClickDuringKeypress.java imports Applet [v2]

Alexander Zvegintsev azvegint at openjdk.org
Wed Mar 20 18:01:26 UTC 2024


On Wed, 20 Mar 2024 17:27:44 GMT, Phil Race <prr at openjdk.org> wrote:

>> This seems to have been some previous not very complete conversion of a test from applet to main.
>> It even still had Applet imported and miscellaneous comments. I've cleaned it up.
>
> Phil Race has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8328560

Marked as reviewed by azvegint (Reviewer).

test/jdk/java/awt/event/MouseEvent/ClickDuringKeypress/ClickDuringKeypress.java line 24:

> 22:  */
> 23: 
> 24: import java.awt.AWTException;

Suggestion:


Unused

test/jdk/java/awt/event/MouseEvent/ClickDuringKeypress/ClickDuringKeypress.java line 34:

> 32: import java.awt.event.WindowAdapter;
> 33: import java.awt.event.WindowEvent;
> 34: import java.awt.event.WindowEvent;

Suggestion:

import java.awt.event.WindowEvent;

test/jdk/java/awt/event/MouseEvent/ClickDuringKeypress/ClickDuringKeypress.java line 54:

> 52:    static volatile Frame frame;
> 53:    static volatile Robot robot;
> 54:    static final ClickDuringKeypress clicker = new ClickDuringKeypress();

On the other hand, we can get rid of the instantiation of this class and MouseListener empty methods overrides by simply adding this:


frame.addMouseListener(new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent e) {
              System.out.println(e.toString());
              clicked = true;
              lastClickCount = e.getClickCount();
          }
      });


Either way, I'm fine with it.

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

PR Review: https://git.openjdk.org/jdk/pull/18386#pullrequestreview-1949640518
PR Review Comment: https://git.openjdk.org/jdk/pull/18386#discussion_r1532556420
PR Review Comment: https://git.openjdk.org/jdk/pull/18386#discussion_r1532544604
PR Review Comment: https://git.openjdk.org/jdk/pull/18386#discussion_r1532555599


More information about the client-libs-dev mailing list