<AWT Dev> [8] Review request JI-9041413: [macosx]"text/uri-list" dataflavor concats the first two strings

Robin Stevens stevensro at gmail.com
Thu Jul 7 07:10:17 UTC 2016


Hello,

the backport of the fix for https://bugs.openjdk.java.net/browse/JDK-8136763
looks incorrect.
The corresponding manual test case fails on jdk8.

The problem: when copy-pasting (or drag-and-dropping) multiple files, the
data in the transferable for the flavor "text/uri-list" concats the first
two paths.

If you for example copy:
/Users/robin/Desktop/file1.txt
/Users/robin/Desktop/file2.txt
/Users/robin/Desktop/file3.txt

the data in the transferable is

/Users/robin/Desktop/file1.txt/Users/robin/Desktop/file2.txt
/Users/robin/Desktop/file3.txt

while the expected data is

/Users/robin/Desktop/file1.txt
/Users/robin/Desktop/file2.txt
/Users/robin/Desktop/file3.txt


This is also what you can observe when running the manual testcase.

I have logged this in the bug database as issue JI-9041413.

Attached you find a webrev with the proposed patch.
The manual testcase succeeds with this patch, and fails without.
At the bottom of this email, you also find the output of hg diff.

The patch does not include a testcase, as there is already one available.

Regards,

Robin


hg diff output:

diff -r 0844fa517c35
src/macosx/classes/sun/lwawt/macosx/CDataTransferer.java
--- a/src/macosx/classes/sun/lwawt/macosx/CDataTransferer.java Tue Jul 05
11:03:13 2016 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CDataTransferer.java Thu Jul 07
08:48:37 2016 +0200
@@ -148,6 +148,7 @@
             StringBuilder sb = new StringBuilder();
             if(strings.length > 0) {
                 sb.append(strings[0]);
+                sb.append(separator);
                 for(int i = 1; i < strings.length; i++) {
                     sb.append(strings[i]);
                     sb.append(separator);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20160707/6bfefda9/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: webrev.zip
Type: application/zip
Size: 43885 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20160707/6bfefda9/webrev-0001.zip>


More information about the awt-dev mailing list