equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
196 oop loader = java_lang_reflect_Module::loader(module_handle()); |
196 oop loader = java_lang_reflect_Module::loader(module_handle()); |
197 if (loader != NULL) { |
197 if (loader != NULL) { |
198 THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), |
198 THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), |
199 "Class loader must be the boot class loader"); |
199 "Class loader must be the boot class loader"); |
200 } |
200 } |
201 Handle h_loader = Handle(THREAD, loader); |
201 Handle h_loader(THREAD, loader); |
202 |
202 |
203 // Ensure the boot loader's PackageEntryTable has been created |
203 // Ensure the boot loader's PackageEntryTable has been created |
204 PackageEntryTable* package_table = get_package_entry_table(h_loader, CHECK); |
204 PackageEntryTable* package_table = get_package_entry_table(h_loader, CHECK); |
205 assert(pkg_list->length() == 0 || package_table != NULL, "Bad package_table"); |
205 assert(pkg_list->length() == 0 || package_table != NULL, "Bad package_table"); |
206 |
206 |
318 package_name, module_name)); |
318 package_name, module_name)); |
319 } |
319 } |
320 |
320 |
321 // Only modules defined to either the boot or platform class loader, can define a "java/" package. |
321 // Only modules defined to either the boot or platform class loader, can define a "java/" package. |
322 if (!h_loader.is_null() && |
322 if (!h_loader.is_null() && |
323 !SystemDictionary::is_platform_class_loader(h_loader) && |
323 !SystemDictionary::is_platform_class_loader(h_loader()) && |
324 strncmp(package_name, JAVAPKG, JAVAPKG_LEN) == 0) { |
324 strncmp(package_name, JAVAPKG, JAVAPKG_LEN) == 0) { |
325 const char* class_loader_name = SystemDictionary::loader_name(h_loader()); |
325 const char* class_loader_name = SystemDictionary::loader_name(h_loader()); |
326 StringUtils::replace_no_expand(package_name, "/", "."); |
326 StringUtils::replace_no_expand(package_name, "/", "."); |
327 const char* msg_text1 = "Class loader (instance of): "; |
327 const char* msg_text1 = "Class loader (instance of): "; |
328 const char* msg_text2 = " tried to define prohibited package name: "; |
328 const char* msg_text2 = " tried to define prohibited package name: "; |
480 oop loader = java_lang_reflect_Module::loader(module_handle()); |
480 oop loader = java_lang_reflect_Module::loader(module_handle()); |
481 if (loader != NULL) { |
481 if (loader != NULL) { |
482 THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), |
482 THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), |
483 "Class loader must be the boot class loader"); |
483 "Class loader must be the boot class loader"); |
484 } |
484 } |
485 Handle h_loader = Handle(THREAD, loader); |
485 Handle h_loader(THREAD, loader); |
486 |
486 |
487 log_debug(modules)("set_bootloader_unnamed_module(): recording unnamed module for boot loader"); |
487 log_debug(modules)("set_bootloader_unnamed_module(): recording unnamed module for boot loader"); |
488 |
488 |
489 // Ensure the boot loader's PackageEntryTable has been created |
489 // Ensure the boot loader's PackageEntryTable has been created |
490 ModuleEntryTable* module_table = get_module_entry_table(h_loader, CHECK); |
490 ModuleEntryTable* module_table = get_module_entry_table(h_loader, CHECK); |