changeset 2844:9538418d25b9

8080815: Update 8u jdeps list of internal APIs Reviewed-by: dfuchs
author mchung
date Thu, 21 May 2015 11:14:23 -0700
parents 6b43535fb9f8
children bacd3cbb4e5e
files src/share/classes/com/sun/tools/jdeps/PlatformClassPath.java test/tools/jdeps/APIDeps.java test/tools/jdeps/m/Gee.java
diffstat 3 files changed, 18 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/jdeps/PlatformClassPath.java	Wed May 20 17:11:28 2015 -0700
+++ b/src/share/classes/com/sun/tools/jdeps/PlatformClassPath.java	Thu May 21 11:14:23 2015 -0700
@@ -46,7 +46,7 @@
  */
 class PlatformClassPath {
     private static final List<String> NON_PLATFORM_JARFILES =
-        Arrays.asList("alt-rt.jar", "jfxrt.jar", "ant-javafx.jar", "javafx-mx.jar");
+        Arrays.asList("alt-rt.jar", "ant-javafx.jar", "javafx-mx.jar");
     private static final List<Archive> javaHomeArchives = init();
 
     static List<Archive> getArchives() {
@@ -124,6 +124,14 @@
      */
     static class JDKArchive extends Archive {
         private static List<String> PROFILE_JARS = Arrays.asList("rt.jar", "jce.jar");
+        // Workaround: The following packages are not annotated as jdk.Exported
+        private static List<String> EXPORTED_PACKAGES = Arrays.asList(
+                "javax.jnlp",
+                "org.w3c.dom.css",
+                "org.w3c.dom.html",
+                "org.w3c.dom.stylesheets",
+                "org.w3c.dom.xpath"
+        );
         public static boolean isProfileArchive(Archive archive) {
             if (archive instanceof JDKArchive) {
                 return PROFILE_JARS.contains(archive.getName());
@@ -155,7 +163,11 @@
          * Tests if a given package name is exported.
          */
         public boolean isExportedPackage(String pn) {
-            if (Profile.getProfile(pn) != null || "javax.jnlp".equals(pn)) {
+            if (Profile.getProfile(pn) != null) {
+                return true;
+            }
+            // special case for JavaFX and APIs that are not annotated with @jdk.Exported)
+            if (EXPORTED_PACKAGES.contains(pn) || pn.startsWith("javafx.")) {
                 return true;
             }
             return exportedPackages.containsKey(pn) ? exportedPackages.get(pn) : false;
--- a/test/tools/jdeps/APIDeps.java	Wed May 20 17:11:28 2015 -0700
+++ b/test/tools/jdeps/APIDeps.java	Thu May 21 11:14:23 2015 -0700
@@ -90,8 +90,9 @@
              new String[] {"-classpath", testDir.getPath(), "-verbose:class", "-filter:none", "-P"});
         test(new File(mDir, "Gee.class"),
              new String[] {"g.G", "sun.misc.Lock", "com.sun.tools.classfile.ClassFile",
-                           "com.sun.management.ThreadMXBean", "com.sun.source.tree.BinaryTree"},
-             new String[] {testDirBasename, "JDK internal API", "compact3", ""},
+                           "com.sun.management.ThreadMXBean", "com.sun.source.tree.BinaryTree",
+                           "org.w3c.dom.css.CSSValue"},
+             new String[] {testDirBasename, "JDK internal API", "compact2", "compact3", ""},
              new String[] {"-classpath", testDir.getPath(), "-verbose", "-P"});
 
         // -jdkinternals
--- a/test/tools/jdeps/m/Gee.java	Wed May 20 17:11:28 2015 -0700
+++ b/test/tools/jdeps/m/Gee.java	Thu May 21 11:14:23 2015 -0700
@@ -29,4 +29,5 @@
     public com.sun.tools.classfile.ClassFile cf;     // @jdk.Exported(false)
     public com.sun.source.tree.BinaryTree tree;      // @jdk.Exported
     public com.sun.management.ThreadMXBean mxbean;   // @jdk.Exported on package-info
+    public org.w3c.dom.css.CSSValue value;           // special case
 }