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

Petr Pchelko petr.pchelko at oracle.com
Thu Jul 17 11:07:11 UTC 2014


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

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20140717/2dcf5710/attachment.html>


More information about the awt-dev mailing list