diff src/share/vm/classfile/classLoader.cpp @ 20608:4cb90023bf2b

8061651: Interface to the Lookup Index Cache to improve URLClassPath search time Summary: Implemented the interface in sun.misc.URLClassPath and corresponding JVM_XXX APIs Reviewed-by: mchung, acorn, jiangli, dholmes
author iklam
date Mon, 13 Oct 2014 16:09:57 -0700
parents f0bedf980c65
children 3375833a603e
line wrap: on
line diff
--- a/src/share/vm/classfile/classLoader.cpp	Tue Oct 28 09:17:36 2014 +0100
+++ b/src/share/vm/classfile/classLoader.cpp	Mon Oct 13 16:09:57 2014 -0700
@@ -610,7 +610,7 @@
 }
 #endif
 
-void ClassLoader::setup_search_path(const char *class_path) {
+void ClassLoader::setup_search_path(const char *class_path, bool canonicalize) {
   int offset = 0;
   int len = (int)strlen(class_path);
   int end = 0;
@@ -625,7 +625,13 @@
     char* path = NEW_RESOURCE_ARRAY(char, end - start + 1);
     strncpy(path, &class_path[start], end - start);
     path[end - start] = '\0';
-    update_class_path_entry_list(path, false);
+    if (canonicalize) {
+      char* canonical_path = NEW_RESOURCE_ARRAY(char, JVM_MAXPATHLEN + 1);
+      if (get_canonical_path(path, canonical_path, JVM_MAXPATHLEN)) {
+        path = canonical_path;
+      }
+    }
+    update_class_path_entry_list(path, /*check_for_duplicates=*/canonicalize);
 #if INCLUDE_CDS
     if (DumpSharedSpaces) {
       check_shared_classpath(path);