<AWT Dev> [9] fix for JDK-8134612 :clipboard.getData(dataFlavor) can throw UnsupportedFlavorException for registered data flavor

Alexandr Scherbatiy alexandr.scherbatiy at oracle.com
Wed Sep 14 15:03:01 UTC 2016


On 9/14/2016 1:14 PM, Ajit Ghaisas wrote:
>
> Hi,
>
> Bug : https://bugs.openjdk.java.net/browse/JDK-8134612
>
> Issue :
>
> In this test, exportToClipboard() does not export anything to the 
> clipboard due to incorrect text passed to TransferHandler.
>
> Obviously, when we do clipboard.getData() - it throws 
> UnsupportedFlavorException. This is the root cause.
>
> Also, when text is imported, the text String cannot be assigned to 
> MyStringReader class.
>
> Fix :
>
> The test is corrected to use custom dataflavor containing String to 
> export and import from clipboard.
>
> Also, the test is enhanced to test a custom dataflavor of Color.
>
> I have referred to :
>
> https://docs.oracle.com/javase/tutorial/uiswing/dnd/dataflavor.html
>
> It passes consistently on Windows, Linux and Mac.
>
> Webrev :
>
> http://cr.openjdk.java.net/~aghaisas/8134612/webrev.00/
>
> Request you to review.
>
   - The test has been designed to check that the reflection in 
DataTransferer.constructFlavoredObject() method properly works with the 
modularization system.
   Could the test be updated  to call  the 
DataTransferer.constructFlavoredObject() method which creates an object 
using flavor.getRepresentationClass() constructor?

  - I also resent the email to the awt-dev alias.

   Thanks,
   Alexandr.
>
> Regards,
>
> Ajit
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20160914/44dc90d8/attachment.html>


More information about the awt-dev mailing list