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

"text/uri-list" dataflavor concats the first two strings

    Details

    • Subcomponent:
    • Resolved In Build:
      b01
    • CPU:
      x86
    • OS:
      other

      Description

      FULL PRODUCT VERSION :
      java version "1.8.0_91"
      Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Darwin MacPro-Robin.local 15.5.0 Darwin Kernel Version 15.5.0: Tue Apr 19 18:36:36 PDT 2016; root:xnu-3248.50.21~8/RELEASE_X86_64 x86_64

      A DESCRIPTION OF THE PROBLEM :
      The backport of issue JDK-8136763 introduced a new bug.

      When you copy-paste, or drag-and-drop 2 files, the data in the transferable for data flavor "text/uri-list" concats the strings.

      For example, if you drag-and-drop files:
      /Users/robin/Desktop/file1.txt
      /Users/robin/Desktop/file2.txt

      the transferable wil contain
      /Users/robin/Desktop/file1.txt/Users/robin/Desktop/file2.txt

      The problem is located in the CDataTransferer#translateBytes method, which is missing an sb.append(separator); call

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Follow the steps of the manual testcase available in the OpenJDK (test/java/awt/datatransfer/DataFlavor/MacOsXFileAndMultipleFileCopingTest/MacOsXFileAndMultipleFileCopingTest.java).

      This test case fails on jdk8, but succeeds on jdk9

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The test case succeeds
      ACTUAL -
      The paths of the first two files are grouped into one string, making it impossible to retrieve the 2 separate paths

      REPRODUCIBILITY :
      This bug can be reproduced always.

        Issue Links

          Activity

          Hide
          alexsch Alexander Scherbatiy (Inactive) added a comment - - edited
          See the discussion: [8] Review request JI-9041413: [macosx]"text/uri-list" dataflavor concats the first two strings
          http://mail.openjdk.java.net/pipermail/awt-dev/2016-July/011620.html

          The proposed webrev: http://cr.openjdk.java.net/~alexsch/robin.stevens/8160941/webrev.00/

          Push the fix with the user id: rstevens
          hg commit -u rstevens
          ------------
          8160941: "text/uri-list" dataflavor concats the first two strings
          ------------
          Show
          alexsch Alexander Scherbatiy (Inactive) added a comment - - edited See the discussion: [8] Review request JI-9041413 : [macosx]"text/uri-list" dataflavor concats the first two strings http://mail.openjdk.java.net/pipermail/awt-dev/2016-July/011620.html The proposed webrev: http://cr.openjdk.java.net/~alexsch/robin.stevens/8160941/webrev.00/ Push the fix with the user id: rstevens hg commit -u rstevens ------------ 8160941: "text/uri-list" dataflavor concats the first two strings ------------
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk8u/jdk8u-dev/jdk/rev/131e388abc48
          User: mcherkas
          Date: 2016-07-15 19:37:24 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk8u/jdk8u-dev/jdk/rev/131e388abc48 User: mcherkas Date: 2016-07-15 19:37:24 +0000
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/rev/131e388abc48
          User: robm
          Date: 2016-07-25 23:21:50 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/rev/131e388abc48 User: robm Date: 2016-07-25 23:21:50 +0000

            People

            • Assignee:
              mcherkas Mikhail Cherkasov (Inactive)
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: