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

[macosx] Drag and drop of link from web browser, DataFlavor types application/x-java-url and text/uri-list, getTransferData returns null

    Details

    • Subcomponent:
    • Resolved In Build:
      b135
    • CPU:
      x86
    • OS:
      os_x

      Description

      FULL PRODUCT VERSION :
      Bug reproduced in jdk8u72, 8u74, 8u77, 8u91, 8u92
      Bug did not reproduce in 8u71 and 8u73.
      java -version for the 8u92 test:

      java version "1.8.0_92"
      Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      MacOS X 10.11.4

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Bug reproduced on various Macs running OS X 10.11.4 (El Capitan) using Chrome version 50.0.2661.94 (64-bit), Firefox 45.0.2, and Safari Version 9.1 (11601.5.17.1). Test case worked on Linux (Fedora 21). Didn't try on Windows.

      A DESCRIPTION OF THE PROBLEM :
      Drag and drop of a link from a web browser fails when the code uses a DataFlavor with mime type application/x-java-url or text/uri-list because the Transferable instance returns true for isDataFlavorSupported{flavior) (that is the DataFlavor can be found in the array returned by getTransferableFlavors()) yet getTransferData(flavor) returns null.

      This can be seen in the example code that is pasted in below. The result is that our application that accepts drag and drop of file links in a web browser that works in Linux and Windows and works on Mac OS X using Java 8u71, no longer works on Mac OS X using the current 8u91 or 8u92. The bug seems to have been introduced in 8u72, but skipped 8u73, appearing again in 8u74 and all later including the current 8u92.

      REGRESSION. Last worked in version 8u73

      ADDITIONAL REGRESSION INFORMATION:
      works in
      java version "1.8.0_71"
      Java(TM) SE Runtime Environment (build 1.8.0_71-b15)
      Java HotSpot(TM) 64-Bit Server VM (build 25.71-b15, mixed mode)


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      On a Mac running OS X 10.11.4 (El Capitan), run the example code pasted in below, in such a way that you can see the text output to stdout. For example you can run the program from the command line in a Terminal window. The code is a self contained class with a main method. The program opens up a blank square pane. Open a web browser. For my test I went to http://example.com which is a page that contains a link with the text "More information..." but any web page with an ordinary html link should do. Drag and drop the link from the web browser to the blank square pane of the test program. The program will print output to stdout.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      This is the output when running the example using Java 8u71, which has correct results, after dragging and dropping the More Information... link from http://example.com

      $ /Library/Java/JavaVirtualMachines/jdk1.8.0_71.jdk/Contents/Home/jre/bin/java -cp . dnd.DragHere
      java.awt.datatransfer.DataFlavor[mimetype=application/x-java-url;representationclass=java.net.URL]: http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.Reader]: java.io.InputStreamReader@550accb1
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.Reader]: java.io.InputStreamReader@6c346718
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.Reader]: java.io.InputStreamReader@4cfd64e4
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.lang.String]: <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><a href="http://www.iana.org/domains/example">More information...</a>
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.lang.String]: <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><a href="http://www.iana.org/domains/example">More information...</a>
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.lang.String]: <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><a href="http://www.iana.org/domains/example">More information...</a>
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.CharBuffer]: <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><a href="http://www.iana.org/domains/example">More information...</a>
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.CharBuffer]: <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><a href="http://www.iana.org/domains/example">More information...</a>
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.CharBuffer]: <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><a href="http://www.iana.org/domains/example">More information...</a>
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[C]: [C@1057fa63
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[C]: [C@133bd39c
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[C]: [C@5c787a44
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-16]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@7b85ef6b
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-16]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@54ae869a
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-16]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@19c408a0
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=UTF-16]: java.nio.HeapByteBuffer[pos=0 lim=272 cap=272]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=UTF-16]: java.nio.HeapByteBuffer[pos=0 lim=272 cap=272]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=UTF-16]: java.nio.HeapByteBuffer[pos=0 lim=272 cap=272]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=UTF-16]: [B@6f1fb86
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=UTF-16]: [B@525ba284
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=UTF-16]: [B@72617403
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-8]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@4bd9f3e7
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-8]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@42fd1cd1
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-8]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@4dbdd988
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-8]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@34057d50
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=UTF-8]: java.nio.HeapByteBuffer[pos=0 lim=135 cap=135]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=UTF-8]: java.nio.HeapByteBuffer[pos=0 lim=135 cap=135]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=UTF-8]: java.nio.HeapByteBuffer[pos=0 lim=135 cap=135]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=UTF-8]: [B@30c7f6fc
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=UTF-8]: [B@1a766fa1
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=UTF-8]: [B@39a484fe
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-16BE]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@26548167
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-16BE]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@29abf347
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-16BE]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@99ab4
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=UTF-16BE]: java.nio.HeapByteBuffer[pos=0 lim=270 cap=270]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=UTF-16BE]: java.nio.HeapByteBuffer[pos=0 lim=270 cap=270]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=UTF-16BE]: java.nio.HeapByteBuffer[pos=0 lim=270 cap=270]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=UTF-16BE]: [B@1d177d3f
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=UTF-16BE]: [B@1f4a9843
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=UTF-16BE]: [B@690d6126
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-16LE]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@251d8a89
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-16LE]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@345e590
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-16LE]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@4886ed3b
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=UTF-16LE]: java.nio.HeapByteBuffer[pos=0 lim=270 cap=270]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=UTF-16LE]: java.nio.HeapByteBuffer[pos=0 lim=270 cap=270]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=UTF-16LE]: java.nio.HeapByteBuffer[pos=0 lim=270 cap=270]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=UTF-16LE]: [B@4a80b15c
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=UTF-16LE]: [B@3803347
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=UTF-16LE]: [B@2fc53fc2
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=ISO-8859-1]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@5055e034
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=ISO-8859-1]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@1f10b133
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=ISO-8859-1]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@1d08a39d
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=ISO-8859-1]: java.nio.HeapByteBuffer[pos=0 lim=135 cap=135]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=ISO-8859-1]: java.nio.HeapByteBuffer[pos=0 lim=135 cap=135]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=ISO-8859-1]: java.nio.HeapByteBuffer[pos=0 lim=135 cap=135]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=ISO-8859-1]: [B@1b35b4d1
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=ISO-8859-1]: [B@649ea3c3
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=ISO-8859-1]: [B@7e9d0f4a
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=US-ASCII]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@26d15f4f
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=US-ASCII]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@10f4f478
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=US-ASCII]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@165dd1e
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=US-ASCII]: java.nio.HeapByteBuffer[pos=0 lim=135 cap=135]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=US-ASCII]: java.nio.HeapByteBuffer[pos=0 lim=135 cap=135]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=US-ASCII]: java.nio.HeapByteBuffer[pos=0 lim=135 cap=135]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=US-ASCII]: [B@17147527
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=US-ASCII]: [B@3b937bad
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=US-ASCII]: [B@cf30f93
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.io.Reader]: java.io.InputStreamReader@23d1be3e
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.lang.String]: http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.nio.CharBuffer]: http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=[C]: [C@17d84a2e
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.io.InputStream;charset=UTF-16]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@37b6056b
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.nio.ByteBuffer;charset=UTF-16]: java.nio.HeapByteBuffer[pos=0 lim=72 cap=72]
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=[B;charset=UTF-16]: [B@232d0b99
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.io.InputStream;charset=UTF-8]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@da3718c
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.io.InputStream;charset=UTF-8]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@587fc32c
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.nio.ByteBuffer;charset=UTF-8]: java.nio.HeapByteBuffer[pos=0 lim=35 cap=35]
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=[B;charset=UTF-8]: [B@5fe50815
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.io.InputStream;charset=UTF-16BE]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@145fb1b3
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.nio.ByteBuffer;charset=UTF-16BE]: java.nio.HeapByteBuffer[pos=0 lim=70 cap=70]
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=[B;charset=UTF-16BE]: [B@2669da5
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.io.InputStream;charset=UTF-16LE]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@24a64866
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.nio.ByteBuffer;charset=UTF-16LE]: java.nio.HeapByteBuffer[pos=0 lim=70 cap=70]
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=[B;charset=UTF-16LE]: [B@53744947
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.io.InputStream;charset=ISO-8859-1]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@3acfb8b3
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.nio.ByteBuffer;charset=ISO-8859-1]: java.nio.HeapByteBuffer[pos=0 lim=35 cap=35]
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=[B;charset=ISO-8859-1]: [B@cf281fa
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.io.InputStream;charset=US-ASCII]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@1a010d7a
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.nio.ByteBuffer;charset=US-ASCII]: java.nio.HeapByteBuffer[pos=0 lim=35 cap=35]
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=[B;charset=US-ASCII]: [B@6bce510c
      java.awt.datatransfer.DataFlavor[mimetype=application/x-java-serialized-object;representationclass=java.lang.String]: http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.Reader]: java.io.InputStreamReader@2c8376e6
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.lang.String]: http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.nio.CharBuffer]: http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=[C]: [C@3466dfdd
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.InputStream;charset=unicode]: java.io.StringReader@269e6ef6
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.nio.ByteBuffer;charset=UTF-16]: java.nio.HeapByteBuffer[pos=0 lim=72 cap=72]
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=[B;charset=UTF-16]: [B@3fc10d18
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.InputStream;charset=UTF-8]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@8c26840
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.InputStream;charset=UTF-8]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@a58d6b2
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.nio.ByteBuffer;charset=UTF-8]: java.nio.HeapByteBuffer[pos=0 lim=35 cap=35]
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=[B;charset=UTF-8]: [B@5fe4f0d1
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.InputStream;charset=UTF-16BE]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@68fa8ff8
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.nio.ByteBuffer;charset=UTF-16BE]: java.nio.HeapByteBuffer[pos=0 lim=70 cap=70]
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=[B;charset=UTF-16BE]: [B@73e16acf
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.InputStream;charset=UTF-16LE]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@3f40df47
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.nio.ByteBuffer;charset=UTF-16LE]: java.nio.HeapByteBuffer[pos=0 lim=70 cap=70]
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=[B;charset=UTF-16LE]: [B@47dad206
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.InputStream;charset=ISO-8859-1]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@7be3104a
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.nio.ByteBuffer;charset=ISO-8859-1]: java.nio.HeapByteBuffer[pos=0 lim=35 cap=35]
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=[B;charset=ISO-8859-1]: [B@3acaaeb
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.InputStream;charset=US-ASCII]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@3aaff73e
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.nio.ByteBuffer;charset=US-ASCII]: java.nio.HeapByteBuffer[pos=0 lim=35 cap=35]
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=[B;charset=US-ASCII]: [B@2b74488f


      ACTUAL -
      This is the output running the same test using Java 8u92

      $ /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/bin/java -cp . dnd.DragHere
      2016-05-04 20:09:37.308 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):
      http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=application/x-java-url;representationclass=java.net.URL]: null
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.Reader]: java.io.InputStreamReader@2525f17f
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.Reader]: java.io.InputStreamReader@490a3aaa
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.Reader]: java.io.InputStreamReader@3ec959df
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.lang.String]: <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><a href="http://www.iana.org/domains/example">More information...</a>
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.lang.String]: <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><a href="http://www.iana.org/domains/example">More information...</a>
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.lang.String]: <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><a href="http://www.iana.org/domains/example">More information...</a>
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.CharBuffer]: <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><a href="http://www.iana.org/domains/example">More information...</a>
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.CharBuffer]: <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><a href="http://www.iana.org/domains/example">More information...</a>
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.CharBuffer]: <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><a href="http://www.iana.org/domains/example">More information...</a>
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[C]: [C@3f6be264
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[C]: [C@354f52ff
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[C]: [C@2d88e196
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-16]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@597b4259
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-16]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@39e3e3d0
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-16]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@767496b9
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=UTF-16]: java.nio.HeapByteBuffer[pos=0 lim=272 cap=272]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=UTF-16]: java.nio.HeapByteBuffer[pos=0 lim=272 cap=272]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=UTF-16]: java.nio.HeapByteBuffer[pos=0 lim=272 cap=272]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=UTF-16]: [B@1c9a4db0
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=UTF-16]: [B@1ff0adf0
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=UTF-16]: [B@392b30bd
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-8]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@6b38a87f
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-8]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@25018f65
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-8]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@3f043918
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-8]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@5fca589d
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=UTF-8]: java.nio.HeapByteBuffer[pos=0 lim=135 cap=135]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=UTF-8]: java.nio.HeapByteBuffer[pos=0 lim=135 cap=135]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=UTF-8]: java.nio.HeapByteBuffer[pos=0 lim=135 cap=135]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=UTF-8]: [B@719f684b
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=UTF-8]: [B@58ccabba
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=UTF-8]: [B@469e8542
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-16BE]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@4b1d33bc
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-16BE]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@41cac7a4
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-16BE]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@7ce6355c
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=UTF-16BE]: java.nio.HeapByteBuffer[pos=0 lim=270 cap=270]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=UTF-16BE]: java.nio.HeapByteBuffer[pos=0 lim=270 cap=270]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=UTF-16BE]: java.nio.HeapByteBuffer[pos=0 lim=270 cap=270]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=UTF-16BE]: [B@4ee01b17
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=UTF-16BE]: [B@6c4251a4
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=UTF-16BE]: [B@7b225c6f
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-16LE]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@3623ca82
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-16LE]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@78d557f2
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=UTF-16LE]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@6e4f63d
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=UTF-16LE]: java.nio.HeapByteBuffer[pos=0 lim=270 cap=270]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=UTF-16LE]: java.nio.HeapByteBuffer[pos=0 lim=270 cap=270]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=UTF-16LE]: java.nio.HeapByteBuffer[pos=0 lim=270 cap=270]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=UTF-16LE]: [B@6f4c13aa
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=UTF-16LE]: [B@4713b31b
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=UTF-16LE]: [B@152b16cc
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=ISO-8859-1]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@345f5f4a
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=ISO-8859-1]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@3b81cb28
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=ISO-8859-1]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@61d02c28
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=ISO-8859-1]: java.nio.HeapByteBuffer[pos=0 lim=135 cap=135]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=ISO-8859-1]: java.nio.HeapByteBuffer[pos=0 lim=135 cap=135]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=ISO-8859-1]: java.nio.HeapByteBuffer[pos=0 lim=135 cap=135]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=ISO-8859-1]: [B@2c00dba8
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=ISO-8859-1]: [B@626b646d
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=ISO-8859-1]: [B@57863b83
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=US-ASCII]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@3757ec37
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=US-ASCII]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@1d20acee
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.io.InputStream;charset=US-ASCII]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@2451fb2b
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=US-ASCII]: java.nio.HeapByteBuffer[pos=0 lim=135 cap=135]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=US-ASCII]: java.nio.HeapByteBuffer[pos=0 lim=135 cap=135]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=java.nio.ByteBuffer;charset=US-ASCII]: java.nio.HeapByteBuffer[pos=0 lim=135 cap=135]
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=US-ASCII]: [B@426d9601
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=US-ASCII]: [B@4ad3ec2f
      java.awt.datatransfer.DataFlavor[mimetype=text/html;representationclass=[B;charset=US-ASCII]: [B@520c7e47
      2016-05-04 20:09:37.476 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):
      http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.io.Reader]: null
      2016-05-04 20:09:37.478 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):
      http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.lang.String]: null
      2016-05-04 20:09:37.480 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):
      http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.nio.CharBuffer]: null
      2016-05-04 20:09:37.482 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):
      http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=[C]: null
      2016-05-04 20:09:37.485 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):
      http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.io.InputStream;charset=UTF-16]: null
      2016-05-04 20:09:37.487 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):
      http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.nio.ByteBuffer;charset=UTF-16]: null
      2016-05-04 20:09:37.489 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):
      http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=[B;charset=UTF-16]: null
      2016-05-04 20:09:37.491 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):
      http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.io.InputStream;charset=UTF-8]: null
      2016-05-04 20:09:37.493 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):
      http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.io.InputStream;charset=UTF-8]: null
      2016-05-04 20:09:37.494 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):
      http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.nio.ByteBuffer;charset=UTF-8]: null
      2016-05-04 20:09:37.496 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):
      http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=[B;charset=UTF-8]: null
      2016-05-04 20:09:37.497 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):
      http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.io.InputStream;charset=UTF-16BE]: null
      2016-05-04 20:09:37.499 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):
      http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.nio.ByteBuffer;charset=UTF-16BE]: null
      2016-05-04 20:09:37.502 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):
      http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=[B;charset=UTF-16BE]: null
      2016-05-04 20:09:37.504 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):
      http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.io.InputStream;charset=UTF-16LE]: null
      2016-05-04 20:09:37.506 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):
      http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.nio.ByteBuffer;charset=UTF-16LE]: null
      2016-05-04 20:09:37.508 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):
      http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=[B;charset=UTF-16LE]: null
      2016-05-04 20:09:37.510 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):
      http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.io.InputStream;charset=ISO-8859-1]: null
      2016-05-04 20:09:37.512 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):
      http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.nio.ByteBuffer;charset=ISO-8859-1]: null
      2016-05-04 20:09:37.514 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):
      http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=[B;charset=ISO-8859-1]: null
      2016-05-04 20:09:37.516 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):
      http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.io.InputStream;charset=US-ASCII]: null
      2016-05-04 20:09:37.517 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):
      http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=java.nio.ByteBuffer;charset=US-ASCII]: null
      2016-05-04 20:09:37.519 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):
      http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/uri-list;representationclass=[B;charset=US-ASCII]: null
      java.awt.datatransfer.DataFlavor[mimetype=application/x-java-serialized-object;representationclass=java.lang.String]: http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.Reader]: java.io.InputStreamReader@79af4f8e
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.lang.String]: http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.nio.CharBuffer]: http://www.iana.org/domains/example
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=[C]: [C@57dc1324
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.InputStream;charset=unicode]: java.io.StringReader@2bb3f64
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.nio.ByteBuffer;charset=UTF-16]: java.nio.HeapByteBuffer[pos=0 lim=72 cap=72]
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=[B;charset=UTF-16]: [B@33f49732
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.InputStream;charset=UTF-8]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@30a47dfd
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.InputStream;charset=UTF-8]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@7561dfe
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.nio.ByteBuffer;charset=UTF-8]: java.nio.HeapByteBuffer[pos=0 lim=35 cap=35]
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=[B;charset=UTF-8]: [B@5c4d426f
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.InputStream;charset=UTF-16BE]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@4b9703d3
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.nio.ByteBuffer;charset=UTF-16BE]: java.nio.HeapByteBuffer[pos=0 lim=70 cap=70]
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=[B;charset=UTF-16BE]: [B@584fc4c9
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.InputStream;charset=UTF-16LE]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@6f419bd3
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.nio.ByteBuffer;charset=UTF-16LE]: java.nio.HeapByteBuffer[pos=0 lim=70 cap=70]
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=[B;charset=UTF-16LE]: [B@5929e26e
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.InputStream;charset=ISO-8859-1]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@2ad3eb03
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.nio.ByteBuffer;charset=ISO-8859-1]: java.nio.HeapByteBuffer[pos=0 lim=35 cap=35]
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=[B;charset=ISO-8859-1]: [B@c9c1b1c
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.InputStream;charset=US-ASCII]: sun.awt.datatransfer.DataTransferer$ReencodingInputStream@6fe0965f
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.nio.ByteBuffer;charset=US-ASCII]: java.nio.HeapByteBuffer[pos=0 lim=35 cap=35]
      java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=[B;charset=US-ASCII]: [B@794c335f



      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Notice that the output pasted in the Actual Result contains multiple error messages that look like

      2016-05-04 20:09:37.308 java[7260:252663] CDataTransferer_dragQueryFile: plist not a valid NSArray (error (null)):


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package dnd;

      import javax.swing.*;
      import java.awt.datatransfer.DataFlavor;
      import java.awt.datatransfer.Transferable;
      import java.awt.datatransfer.UnsupportedFlavorException;
      import java.io.IOException;

      /**
       * Test code copied from https://bugs.openjdk.java.net/browse/JDK-8031964
       * different bug but this code shows what is needed in this case too
       */

      public class DragHere {

          public static void main(String[] args) {
              final JFrame frame = new JFrame();
              final JPanel panel = new JPanel();
              frame.getContentPane().add(panel);
              panel.setTransferHandler(new TransferHandler(){
                  @Override
                  public boolean canImport(final TransferSupport support) {
                      return true;
                  }

                  @Override
                  public boolean importData(final TransferSupport support) {
                      final Transferable transferable = support.getTransferable();
                      final DataFlavor[] flavors = transferable.getTransferDataFlavors();
                      for (final DataFlavor flavor : flavors){
                          try {
                              final Object transferData = transferable.getTransferData(flavor);
                              System.out.print(flavor + ":\t");
                              System.out.println(transferData);
                          } catch (UnsupportedFlavorException e) {
                              System.out.println("UnspportedFlavorException: "+e.getMessage());
                              e.printStackTrace();
                          } catch (IOException e) {
                              System.out.println("IOException: "+e.getMessage());
                              e.printStackTrace();
                          }
                      }
                      return true;
                  }
              });
              SwingUtilities.invokeLater(new Runnable() {
                  @Override
                  public void run() {
                      frame.setBounds(100, 100, 100, 100);
                      frame.setVisible(true);
                  }
              });
          }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      The application typically has a Transferable instance which I will call transferable and a DataFlavor instance which I will call dataFlavor, then does something like

          if (transferable.isDataFlavorSupported(dataFlavor)) { ... do something with transferable.getTransferData(dataFlavor) ...} else { .. use a different DataFlavor ...}

      Instead if transferable.isDataFlavorSupported(dataFlavor) returns true then get the value returned by transferable.getTransferData(dataFlavor) and check if it is null. If it is null then follow the code path that would have been taken if transferable.isDataFlavorSupported(dataFlavor) had returned false.

      This is not a complete workaround because the application/x-java-url and text/uri-list mime type DataFlavors are not handled, but often the application has a fallback of using text/plain DataFlavor when the others are not available and that works well enough.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mhalder Manajit Halder (Inactive)
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                1 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: