RFR: JDK-8307128: Open source some drag and drop tests 4

Andrey Turbanov aturbanov at openjdk.org
Thu May 4 20:26:26 UTC 2023


On Tue, 2 May 2023 22:09:18 GMT, Alisen Chung <achung at openjdk.org> wrote:

> added DnD tests

test/jdk/java/awt/dnd/MozillaDnDTest.java line 97:

> 95:             } finally {
> 96:                 EventQueue.invokeAndWait(() -> {
> 97:                     if(test.frame != null) {

Suggestion:

                    if (test.frame != null) {

test/jdk/java/awt/dnd/MozillaDnDTest.java line 347:

> 345:                     // the variable finished is set to true.
> 346:                     pres.exitValue = p.exitValue();
> 347:                     finished  = true;

Suggestion:

                    finished = true;

test/jdk/java/awt/dnd/MultiDataFlavorDropTest.java line 378:

> 376: 
> 377:             if (flavor.getRepresentationClass().equals(Integer.class)) {
> 378:                 try{

Suggestion:

                try {

test/jdk/java/awt/dnd/MultiDataFlavorDropTest.java line 380:

> 378:                 try{
> 379:                     transferNumber = (Integer)t.getTransferData(flavor);
> 380:                 } catch(Exception e) {

Suggestion:

                } catch (Exception e) {

test/jdk/java/awt/dnd/MultiDataFlavorDropTest.java line 390:

> 388:             for (int j = 0; j < TransferableNumber.NUM_DATA_FLAVORS; j++) {
> 389:                 int number = (i + j) % TransferableNumber.NUM_DATA_FLAVORS;
> 390:                 try{

Suggestion:

                try {

test/jdk/java/awt/dnd/MultiDataFlavorDropTest.java line 400:

> 398:                         break;
> 399:                     }
> 400:                 } catch(ClassNotFoundException cannotHappen) {

Suggestion:

                } catch (ClassNotFoundException cannotHappen) {

test/jdk/java/awt/dnd/NativeDragJavaDropTest.java line 140:

> 138:         DataFlavor[] dfs = dtde.getCurrentDataFlavors();
> 139: 
> 140:         if(dfs != null && dfs.length >= 1) {

Suggestion:

        if (dfs != null && dfs.length >= 1) {

test/jdk/java/awt/dnd/NestedHeavyweightDropTargetTest.java line 478:

> 476:         Component comp = null;
> 477: 
> 478:         if(dfs != null && dfs.length >= 1) {

Suggestion:

        if (dfs != null && dfs.length >= 1) {

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13765#discussion_r1185477231
PR Review Comment: https://git.openjdk.org/jdk/pull/13765#discussion_r1185477419
PR Review Comment: https://git.openjdk.org/jdk/pull/13765#discussion_r1185477864
PR Review Comment: https://git.openjdk.org/jdk/pull/13765#discussion_r1185477973
PR Review Comment: https://git.openjdk.org/jdk/pull/13765#discussion_r1185478088
PR Review Comment: https://git.openjdk.org/jdk/pull/13765#discussion_r1185478199
PR Review Comment: https://git.openjdk.org/jdk/pull/13765#discussion_r1185478362
PR Review Comment: https://git.openjdk.org/jdk/pull/13765#discussion_r1185477637



More information about the client-libs-dev mailing list