changeset 10861:ccf8cc465b84 jdk-11+4

8195806: Eliminate dependency on sun.font.lookup in javafx.graphics Reviewed-by: prr, kcr
author aghaisas
date Tue, 06 Mar 2018 12:38:36 +0530
parents f7fb44c05041
children 74a27d49d1a9
files build.gradle dependencies/java.desktop/module-info.java.extra modules/javafx.graphics/src/main/java/com/sun/javafx/font/PrismFontFactory.java
diffstat 3 files changed, 4 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/build.gradle	Fri Mar 02 15:11:42 2018 -0800
+++ b/build.gradle	Tue Mar 06 12:38:36 2018 +0530
@@ -1591,7 +1591,6 @@
     "--add-exports=java.base/sun.util.logging=javafx.controls",
     "--add-exports=java.base/sun.util.logging=javafx.fxml",
     "--add-exports=java.base/sun.util.logging=javafx.graphics",
-    "--add-exports=java.desktop/sun.font.lookup=javafx.graphics",
     "--add-exports=java.desktop/sun.print=javafx.graphics",
 ]
 
--- a/dependencies/java.desktop/module-info.java.extra	Fri Mar 02 15:11:42 2018 -0800
+++ b/dependencies/java.desktop/module-info.java.extra	Tue Mar 06 12:38:36 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,5 +29,4 @@
 exports sun.awt.image to javafx.swing;
 exports sun.java2d to javafx.swing;
 exports sun.swing to javafx.swing;
-exports sun.font.lookup to javafx.graphics;
 exports sun.print to javafx.graphics;
--- a/modules/javafx.graphics/src/main/java/com/sun/javafx/font/PrismFontFactory.java	Fri Mar 02 15:11:42 2018 -0800
+++ b/modules/javafx.graphics/src/main/java/com/sun/javafx/font/PrismFontFactory.java	Tue Mar 06 12:38:36 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -157,20 +157,8 @@
     }
 
     private static String getJDKFontDir() {
-        try {
-            Class<?> c = Class.forName("sun.font.lookup.JDKFontLookup");
-            Method m = c.getMethod("getJDKFontDir");
-            jreFontDir = (String)m.invoke(c);
-            return jreFontDir;
-        } catch (Throwable t) {
-            if (debugFonts) {
-                System.err.println("Could not get JRE font dir via API");
-                t.printStackTrace();
-            }
-        }
-        return
-            System.getProperty("java.home","") + File.separator +
-                "lib" + File.separator + "fonts" + File.separator;
+        return System.getProperty("java.home","") + File.separator +
+                "lib" + File.separator + "fonts";
     }
 
     private static String getNativeFactoryName() {