[OpenJDK 2D-Dev] RFR: 8035302: Eliminate dependency on sun.nio.cs from AWT and Motif code

Mandy Chung mandy.chung at oracle.com
Fri Feb 20 04:50:20 UTC 2015

On 2/19/2015 4:23 PM, Phil Race wrote:
> http://cr.openjdk.java.net/~prr/8035302/

I'll let Sherman and others to do the detailed review here.  Minor comment:

    line 56-58: can use try-with-resource.
    line 62: should it throw UncheckedIOException?

> With this change, for the benefit of jigsaw, the Charset support 
> needed by the font code
> now uses just the public APIs. 

java.desktop to the internal of charsets is an undesirable edge in the 
module graph [1].  Thank you for eliminating it.  It's not ideal to copy 
sun.nio code while some day these sun.awt.motif.** will no longer be 
needed and can be removed.

With this dependency removed,  <top-repo>/modules.xml needs to be 
updated.  Here is the patch:

diff --git a/modules.xml b/modules.xml
--- a/modules.xml
+++ b/modules.xml
@@ -294,7 +294,6 @@
-      <to>java.desktop</to>
@@ -602,7 +601,6 @@
      <depend re-exports="true">java.xml</depend>
      <depend re-exports="true">java.datatransfer</depend>
-    <depend>jdk.charsets</depend>
@@ -1481,10 +1479,6 @@
-    <export>
-      <name>sun.nio.cs.ext</name>
-      <to>java.desktop</to>
-    </export>

Run make verify-modules to verify the dependencis or make images will do it too.

[1] http://openjdk.java.net/jeps/200

More information about the 2d-dev mailing list