RFR: 8354248: Open source several AWT GridBagLayout and List tests

Abhishek Kumar abhiscxk at openjdk.org
Fri Apr 18 11:15:47 UTC 2025


On Fri, 18 Apr 2025 07:45:11 GMT, Tejesh R <tr at openjdk.org> wrote:

> Open source these AWT GridBagLayout and List tests:
> 
> java/awt/GridBagLayout/ComponentShortage/ComponentShortage.java
> java/awt/List/ListScrollbarCursorTest/ListScrollbarCursorTest.java
> java/awt/List/ListScrollbarTest/ListScrollbarTest.java

test/jdk/java/awt/GridBagLayout/ComponentShortage.java line 45:

> 43:     static JTextField jtf;
> 44:     static Dimension size;
> 45:     static Dimension fSize;

Should be Volatile ?
Accessed on EDT and main thread

test/jdk/java/awt/List/ListScrollbarCursorTest.java line 49:

> 47:                 """;
> 48:         PassFailJFrame.builder()
> 49:                 .title("Test Instructions")

Title is not required.

test/jdk/java/awt/List/ListScrollbarTest.java line 69:

> 67:                 """;
> 68:         PassFailJFrame.builder()
> 69:                 .title("Test Instructions")

Can be removed

test/jdk/java/awt/List/ListScrollbarTest.java line 142:

> 140:                 l2.addItem(l1.getItem(i));
> 141:             }
> 142:             l1.delItems(0, l1.countItems() - 1);    // or l1.clear();

Is this comment required?

test/jdk/java/awt/List/ListScrollbarTest.java line 143:

> 141:             }
> 142:             l1.delItems(0, l1.countItems() - 1);    // or l1.clear();
> 143:         } else { //else move the selected items

For consistency in comments

Suggestion:

        } else { // else move the selected items

test/jdk/java/awt/List/ListScrollbarTest.java line 150:

> 148:             for (int i = 0; i < items.length; i++) {
> 149:                 l2.addItem(items[i]);        // add it
> 150:                 l2.select(l2.countItems() - 1);// and select it

Comments are redundant.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24749#discussion_r2050487877
PR Review Comment: https://git.openjdk.org/jdk/pull/24749#discussion_r2050489191
PR Review Comment: https://git.openjdk.org/jdk/pull/24749#discussion_r2050497456
PR Review Comment: https://git.openjdk.org/jdk/pull/24749#discussion_r2050498285
PR Review Comment: https://git.openjdk.org/jdk/pull/24749#discussion_r2050498159
PR Review Comment: https://git.openjdk.org/jdk/pull/24749#discussion_r2050498497


More information about the client-libs-dev mailing list