hotspot/src/share/vm/classfile/modules.cpp
changeset 40013 943cf01a6b82
parent 39706 8b8fd966478b
child 40020 20738e6bef83
--- a/hotspot/src/share/vm/classfile/modules.cpp	Tue Jul 26 11:04:20 2016 +0200
+++ b/hotspot/src/share/vm/classfile/modules.cpp	Tue Jul 26 10:29:27 2016 -0400
@@ -133,36 +133,6 @@
   return NULL;
 }
 
-// If using exploded build, append <java.home>/modules/module_name, if it exists,
-// to the system boot class path in order for the boot loader to locate class files.
-static void add_to_exploded_build_list(char *module_name, TRAPS) {
-  assert(!ClassLoader::has_jimage(), "Exploded build not applicable");
-  // java.base is handled by os::set_boot_path
-  assert(strcmp(module_name, "java.base") != 0, "Unexpected java.base module name");
-
-  char file_sep = os::file_separator()[0];
-  size_t module_len = strlen(module_name);
-
-  const char* home = Arguments::get_java_home();
-  size_t len = strlen(home) + module_len + 32;
-  char* path = NEW_C_HEAP_ARRAY(char, len, mtModule);
-  jio_snprintf(path, len, "%s%cmodules%c%s", home, file_sep, file_sep, module_name);
-  struct stat st;
-  // See if exploded module path exists
-  if ((os::stat(path, &st) != 0)) {
-    FREE_C_HEAP_ARRAY(char, path);
-    path = NULL;
-  }
-
-  if (path != NULL) {
-    HandleMark hm;
-    Handle loader_lock = Handle(THREAD, SystemDictionary::system_loader_lock());
-    ObjectLocker ol(loader_lock, THREAD);
-    log_info(class, load)("opened: %s", path);
-    ClassLoader::add_to_list(path);
-  }
-}
-
 bool Modules::is_package_defined(Symbol* package, Handle h_loader, TRAPS) {
   PackageEntry* res = get_package_entry_by_name(package, h_loader, CHECK_false);
   return res != NULL;
@@ -470,8 +440,8 @@
   // used, prepend <java.home>/modules/modules_name, if it exists, to the system boot class path.
   if (loader == NULL &&
       !Universe::is_module_initialized() &&
-      !ClassLoader::has_jimage()) {
-    add_to_exploded_build_list(module_name, CHECK);
+      !ClassLoader::has_jrt_entry()) {
+    ClassLoader::add_to_exploded_build_list(module_symbol, CHECK);
   }
 }