Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8252375

[macos] Drag of more than one node to the finder crashes javafx/jdk | OpenJDK build 14

    XMLWordPrintable

Details

    • x86_64
    • os_x

    Description

      ADDITIONAL SYSTEM INFORMATION :
      OSX 10.15.6
      openjdk version "14" 2020-03-17
      OpenJDK Runtime Environment AdoptOpenJDK (build 14+36)
      OpenJDK 64-Bit Server VM AdoptOpenJDK (build 14+36, mixed mode, sharing)
      Javafx 15ea+8

      A DESCRIPTION OF THE PROBLEM :
      If have a e.g. a ListView and drag two items out of it to the finder than an NS Exception is thrown with the text including a complete crash of the JDK:



      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Create a list view with more than one item
      2. Implement setOnDragDetected event
      3. Use method ClipboardContent.putFiles with more than two entry's in the ArrayList
      4. Put the content on the dragboard of the listview
      5. Start javafx app and drag two entry's to the finder -> Crash of the JDK

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      In Finder two files are saved on the drop folder (fine under Win10).
      ACTUAL -
      Crash of the whole JDK including JavaFX

      2020-08-21 22:55:27.547 java[3427:24115] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'There are 2 items on the pasteboard, but 1 drag images. There must be 1 draggingItem per pasteboardItem.'
      *** First throw call stack:
      (
      0 CoreFoundation 0x00007fff36513727 __exceptionPreprocess + 250
      1 libobjc.A.dylib 0x00007fff6f416a9e objc_exception_throw + 48
      2 CoreFoundation 0x00007fff36513585 +[NSException raise:format:] + 181
      3 AppKit 0x00007fff33a7037a -[NSDraggingSession(NSInternal) _initWithPasteboard:image:offset:source:] + 243
      4 AppKit 0x00007fff33a6fdb1 -[NSCoreDragManager dragImage:fromWindow:at:offset:event:pasteboard:source:slideBack:] + 1889
      5 AppKit 0x00007fff33a6f63f -[NSWindow(NSDrag) dragImage:at:offset:event:pasteboard:source:slideBack:] + 134
      6 libglass.dylib 0x00000001373da738 -[GlassViewDelegate startDrag:] + 1080
      7 libglass.dylib 0x00000001373e45f7 Java_com_sun_glass_ui_mac_MacPasteboard__1putItemsFromArray + 2439
      8 ??? 0x000000012078d630 0x0 + 4839757360
      )
      libc++abi.dylib: terminating with uncaught exception of type NSException
      Command execution failed.
      org.apache.commons.exec.ExecuteException: Process exited with an error: 134 (Exit value: 134)
          at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:404)
          at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:166)
          at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:764)
          at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:711)
          at org.codehaus.mojo.exec.ExecMojo.execute (ExecMojo.java:289)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
          at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
          at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
          at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
          at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
          at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
          at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke (Method.java:564)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
          at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

      ---------- BEGIN SOURCE ----------
      imageGrid.setOnDragDetected((t) -> {
                  /* drag was detected, start a drag-and-drop gesture*/
                  Dragboard db = imageGrid.startDragAndDrop(TransferMode.ANY);
                  final ClipboardContent content = new ClipboardContent();
                  List<File> fileList = new ArrayList<>();
                  Set<Node> selection = factory.getSelectionModel().getSelection();
                  selection.forEach((k) -> {
                      fileList.add(new File(((MediaGridCell) k).getItem().getName()));
                  });
                  content.putFiles(fileList);
                  db.setContent(content);
                  t.consume();
              });
      ---------- END SOURCE ----------

      FREQUENCY : always


      Attachments

        Issue Links

          Activity

            People

              pnarayanaswa Praveen Narayanaswamy
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: