jdk/src/share/classes/java/awt/color/ICC_Profile.java
changeset 4209 e2e5a973b879
parent 4206 8925b5c1334b
parent 3958 b8acd5ee4f4f
child 4238 cf990c80a8c2
--- a/jdk/src/share/classes/java/awt/color/ICC_Profile.java	Thu Sep 24 22:50:41 2009 +0100
+++ b/jdk/src/share/classes/java/awt/color/ICC_Profile.java	Tue Oct 06 21:40:55 2009 -0700
@@ -58,6 +58,8 @@
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 
+import sun.misc.BootClassLoaderHook;
+
 /**
  * A representation of color profile data for device independent and
  * device dependent color spaces based on the International Color
@@ -1830,8 +1832,19 @@
                     dir = st.nextToken();
                         fullPath = dir + File.separatorChar + fileName;
                     f = new File(fullPath);
-                    if (!isChildOf(f, dir)) {
-                        f = null;
+                }
+            }
+
+        if (!f.isFile()) { /* try the directory of built-in profiles */
+            dir = System.getProperty("java.home") +
+                File.separatorChar + "lib" + File.separatorChar + "cmm";
+            fullPath = dir + File.separatorChar + fileName;
+                f = new File(fullPath);
+                if (!f.isFile()) {
+                    //make sure file was installed in the kernel mode
+                    BootClassLoaderHook hook = BootClassLoaderHook.getHook();
+                    if (hook.getHook() != null) {
+                        hook.prefetchFile("lib/cmm/"+fileName);
                     }
                 }
             }