On Thu, 14 Sep 2023 16:43:29 GMT, Damon Nguyen <dngu...@openjdk.org> wrote:

> These are the tests being converted:
> 
> javax/swing/JToolBar/4138694/bug4138694.java
> javax/swing/JToolBar/4140421/bug4140421.java
> javax/swing/JToolBar/4196662/bug4196662.java
> javax/swing/JToolBar/4243930/bug4243930.java

test/jdk/javax/swing/JToolBar/bug4138694.java line 48:

> 46:     public static void main(String[] args) throws InterruptedException,
> 47:             InvocationTargetException {
> 48:         SwingUtilities.invokeAndWait(() -> {

This code can be safely run on the main thread, it does not depend on handling 
any events.

test/jdk/javax/swing/JToolBar/bug4138694.java line 54:

> 52:             jtb.add(aa);
> 53:             JComponent c = (JComponent)jtb.getComponentAtIndex(0);
> 54:             if (!c.getToolTipText().equals("Action")) {

You may want to introduce a constant for `"Action"`.

test/jdk/javax/swing/JToolBar/bug4140421.java line 38:

> 36:     public static void main(String[] args) throws InterruptedException,
> 37:             InvocationTargetException {
> 38:         SwingUtilities.invokeAndWait(() -> {

This code can be run safely on the main thread.

test/jdk/javax/swing/JToolBar/bug4196662.java line 39:

> 37:     public static void main(String[] args) throws InterruptedException,
> 38:             InvocationTargetException {
> 39:         SwingUtilities.invokeAndWait(() -> {

I think this can also be run on the main thread, if you like.

test/jdk/javax/swing/JToolBar/bug4243930.java line 48:

> 46:     public static void main(String[] argv) throws InterruptedException,
> 47:             InvocationTargetException {
> 48:         SwingUtilities.invokeAndWait(() -> {

Also safe to run on the main thread.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15748#discussion_r1328761906
PR Review Comment: https://git.openjdk.org/jdk/pull/15748#discussion_r1328763099
PR Review Comment: https://git.openjdk.org/jdk/pull/15748#discussion_r1328764305
PR Review Comment: https://git.openjdk.org/jdk/pull/15748#discussion_r1328767371
PR Review Comment: https://git.openjdk.org/jdk/pull/15748#discussion_r1328770419

Reply via email to