< prev index next >
src/hotspot/share/classfile/sharedClassUtil.cpp
Print this page
@@ -171,17 +171,15 @@
void SharedClassUtil::initialize(TRAPS) {
if (UseSharedSpaces) {
int size = FileMapInfo::get_number_of_shared_paths();
if (size > 0) {
SystemDictionaryShared::allocate_shared_data_arrays(size, THREAD);
- if (!DumpSharedSpaces) {
FileMapHeaderExt* header = (FileMapHeaderExt*)FileMapInfo::current_info()->header();
ClassLoaderExt::init_paths_start_index(header->_app_class_paths_start_index);
ClassLoaderExt::init_app_module_paths_start_index(header->_app_module_paths_start_index);
}
}
- }
if (DumpSharedSpaces) {
if (SharedArchiveConfigFile) {
read_extra_data(SharedArchiveConfigFile, THREAD);
}
@@ -227,23 +225,24 @@
_verify_remote = BytecodeVerificationRemote;
_has_platform_or_app_classes = ClassLoaderExt::has_platform_or_app_classes();
}
bool FileMapHeaderExt::validate() {
- if (UseAppCDS) {
- const char* prop = Arguments::get_property("java.system.class.loader");
- if (prop != NULL) {
- warning("UseAppCDS is disabled because the java.system.class.loader property is specified (value = \"%s\"). "
- "To enable UseAppCDS, this property must be not be set", prop);
- UseAppCDS = false;
- }
- }
-
if (!FileMapInfo::FileMapHeader::validate()) {
return false;
}
+ // This must be done after header validation because it might change the
+ // header data
+ const char* prop = Arguments::get_property("java.system.class.loader");
+ if (prop != NULL) {
+ warning("Archived non-system classes are disabled because the "
+ "java.system.class.loader property is specified (value = \"%s\"). "
+ "To use archived non-system classes, this property must be not be set", prop);
+ _has_platform_or_app_classes = false;
+ }
+
// For backwards compatibility, we don't check the verification setting
// if the archive only contains system classes.
if (_has_platform_or_app_classes &&
((!_verify_local && BytecodeVerificationLocal) ||
(!_verify_remote && BytecodeVerificationRemote))) {
< prev index next >