<AWT Dev> [9] Review Request: 8037485 Refactor java.awt.datatransfer to eliminate dependency on AWT

Alan Bateman Alan.Bateman at oracle.com
Fri Jul 18 09:15:47 UTC 2014


On 17/07/2014 12:07, Petr Pchelko wrote:
> Hello,
>
> Please review the fix for the issue:
> https://bugs.openjdk.java.net/browse/JDK-8037485
> The fix is available at:
> http://cr.openjdk.java.net/~pchelko/9/8037485/webrev.00 
> <http://cr.openjdk.java.net/%7Epchelko/9/8037485/webrev.00>
>
> This fix separates the public datatransfer API from the desktop 
> module. The datatransfer module would contain java.awt.datatransfer 
> and sun.awt.datatransfer packages.
> The sun.awt.datatransfer.desktop contains platform-dependent features 
> of the datatransfer system and belongs to the desktop module. So, most 
> of the changes are just package renaming.
>
> DataTransferer class was split into 2 parts:
> 1. Utilities to work with the DataFlavor is moved to the 
> DataFlavorUtil class. It's just a collection of uility functions and 
> classes
> 2. Java objects to native representation converters are left in the 
> DataTransferer class and moved to the desktop module. It's needed only 
> with DnD and system clipboard API, so it naturally belong to desktop.
>
> DesktopDatatransferServices was created. This is a collection of 
> services that datatrasfer module could use from desktop if desktop is 
> present. ServiceLoader is used because reflection does not cross 
> module boundaries for non-exported APIs
>
> RMIAccessServices - a collection of services which RMI module might 
> provide to desktop and datatransfer. If RMI module is present we can 
> transfer RMI classes. If not - we cannot.
>
> The fix was tested on all platforms with jtreg and JCK. No new test 
> failures found. Also the fix was tested without the RMI and without 
> the desktop module.
Mandy and I had a brief discussion with Petr about this. One suggestion 
is to separate out the changes related to RMI as there are other 
approaches there. This would also make it a bit easier to review the 
most important work to factor out the datatransfer API.

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


More information about the awt-dev mailing list