I skimmed through the sources.  It's good to see that this patch
is straight forward.  A couple of comments:

jdk.unsupported.desktop is defined to the application class loader
which I think it's fine as FX modules are defined to the same class
loader.

I expect src/java.base/share/lib/security/default.security will
need to be modified and grant permissions to jdk.unsupported.desktop.
Kevin and I talked about potential issues with running with security
manager enabled.  Maybe it is a separate task to follow up and it
may reveal if any operation needs doPrivileged - that's fine with me.

The docs build starts with a known set of root modules for javadoc
generation.  I believe jdk.unsupported.desktop won't be included
in the docs build which is intended (as it's unsupported).  Can
you verify it?

Nit: jdk.swing.interop.* source files
it'd be good to keep import statements sorted by the names.

Mandy

On 5/4/18 5:00 AM, Prasanta Sadhukhan wrote:
Hi All,

Please review an enhancement to remove the tight coupling of JDK internal class from FX so that when javafx.* modules are removed from Openjdk build in jdk11, FX in general, and fx swing interop, in particular, can still build and function.

Right now, FX uses 6 jdk internal packages
sun.swing, sun.awt, java.awt.dnd.peer, sun.awt.dnd, sun.awt.image and sun.java2d.

However, the goal is not to use qualified exports of these internal packages once FX is removed to be built along with JDK,

The solution will define a new "jdk.unsupported.desktop" module that exports public API that is intended to be used by the javafx.swing module (but it does so with public exports and not qualified exports). The idea is the same as jdk.unsupported, in that it is documented as being unsupported. Further, since it is only intended to be used by javafx.swing, it need not be in the default module graph.

The module-info.java will look like this:
|module jdk.unsupported.desktop { requires transitive java.desktop; exports jdk.swing.interop; } ||| Enhancement: https://bugs.openjdk.java.net/browse/JDK-8202199, https://bugs.openjdk.java.net/browse/JDK-8195811
webrev: cr.openjdk.java.net/~psadhukhan/fxswing.6/
CSR: https://bugs.openjdk.java.net/browse/JDK-8202175

Regards
Prasanta
||


Reply via email to