< prev index next >
src/share/vm/classfile/modules.cpp
Print this page
*** 236,249 ****
--- 236,251 ----
module_version != NULL ? module_version : "NULL",
module_location != NULL ? module_location : "NULL",
pkg_list->length());
// packages defined to java.base
+ if (log_is_enabled(Trace, modules)) {
for (int x = 0; x < pkg_list->length(); x++) {
log_trace(modules)("define_javabase_module(): creation of package %s for module " JAVA_BASE_NAME,
(pkg_list->at(x))->as_C_string());
}
+ }
}
// Caller needs ResourceMark.
void throw_dup_pkg_exception(const char* module_name, PackageEntry* package, TRAPS) {
const char* package_name = package->name()->as_C_string();
*** 256,266 ****
err_msg("Package %s for module %s is already in the unnamed module defined to the class loader",
package_name, module_name));
}
}
! void Modules::define_module(jobject module, jstring version,
jstring location, const char* const* packages,
jsize num_packages, TRAPS) {
ResourceMark rm(THREAD);
if (module == NULL) {
--- 258,268 ----
err_msg("Package %s for module %s is already in the unnamed module defined to the class loader",
package_name, module_name));
}
}
! void Modules::define_module(jobject module, jboolean is_open, jstring version,
jstring location, const char* const* packages,
jsize num_packages, TRAPS) {
ResourceMark rm(THREAD);
if (module == NULL) {
*** 289,298 ****
--- 291,301 ----
"Module name cannot be null");
}
// Special handling of java.base definition
if (strcmp(module_name, JAVA_BASE_NAME) == 0) {
+ assert(is_open == JNI_FALSE, "java.base module cannot be open");
define_javabase_module(module, version, location, packages, num_packages, CHECK);
return;
}
const char* module_version = get_module_version(version);
*** 392,402 ****
} // if (num_packages > 0)...
// Add the module and its packages.
if (!dupl_modules && existing_pkg == NULL) {
// Create the entry for this module in the class loader's module entry table.
! ModuleEntry* module_entry = module_table->locked_create_entry_or_null(module_handle, module_symbol,
version_symbol, location_symbol, loader_data);
if (module_entry == NULL) {
dupl_modules = true;
} else {
--- 395,406 ----
} // if (num_packages > 0)...
// Add the module and its packages.
if (!dupl_modules && existing_pkg == NULL) {
// Create the entry for this module in the class loader's module entry table.
! ModuleEntry* module_entry = module_table->locked_create_entry_or_null(module_handle,
! (is_open == JNI_TRUE), module_symbol,
version_symbol, location_symbol, loader_data);
if (module_entry == NULL) {
dupl_modules = true;
} else {
*** 500,511 ****
if (from_module_entry == NULL) {
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
"from_module cannot be found");
}
! // All packages in unnamed are exported by default.
! if (!from_module_entry->is_named()) return;
ModuleEntry* to_module_entry;
if (to_module == NULL) {
to_module_entry = NULL; // It's an unqualified export.
} else {
--- 504,515 ----
if (from_module_entry == NULL) {
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
"from_module cannot be found");
}
! // All packages in unnamed and open modules are exported by default.
! if (!from_module_entry->is_named() || from_module_entry->is_open()) return;
ModuleEntry* to_module_entry;
if (to_module == NULL) {
to_module_entry = NULL; // It's an unqualified export.
} else {
< prev index next >