1310 }
1311
1312 if (NULL == stream) {
1313 return NULL;
1314 }
1315
1316 stream->set_verify(ClassLoaderExt::should_verify(classpath_index));
1317
1318 ClassLoaderData* loader_data = ClassLoaderData::the_null_class_loader_data();
1319 Handle protection_domain;
1320
1321 InstanceKlass* result = KlassFactory::create_from_stream(stream,
1322 name,
1323 loader_data,
1324 protection_domain,
1325 NULL, // unsafe_anonymous_host
1326 NULL, // cp_patches
1327 THREAD);
1328 if (HAS_PENDING_EXCEPTION) {
1329 if (DumpSharedSpaces) {
1330 tty->print_cr("Preload Error: Failed to load %s", class_name);
1331 }
1332 return NULL;
1333 }
1334
1335 if (!add_package(file_name, classpath_index, THREAD)) {
1336 return NULL;
1337 }
1338
1339 return result;
1340 }
1341
1342 #if INCLUDE_CDS
1343 char* ClassLoader::skip_uri_protocol(char* source) {
1344 if (strncmp(source, "file:", 5) == 0) {
1345 // file: protocol path could start with file:/ or file:///
1346 // locate the char after all the forward slashes
1347 int offset = 5;
1348 while (*(source + offset) == '/') {
1349 offset++;
1350 }
|
1310 }
1311
1312 if (NULL == stream) {
1313 return NULL;
1314 }
1315
1316 stream->set_verify(ClassLoaderExt::should_verify(classpath_index));
1317
1318 ClassLoaderData* loader_data = ClassLoaderData::the_null_class_loader_data();
1319 Handle protection_domain;
1320
1321 InstanceKlass* result = KlassFactory::create_from_stream(stream,
1322 name,
1323 loader_data,
1324 protection_domain,
1325 NULL, // unsafe_anonymous_host
1326 NULL, // cp_patches
1327 THREAD);
1328 if (HAS_PENDING_EXCEPTION) {
1329 if (DumpSharedSpaces) {
1330 log_error(cds)("Preload Error: Failed to load %s", class_name);
1331 }
1332 return NULL;
1333 }
1334
1335 if (!add_package(file_name, classpath_index, THREAD)) {
1336 return NULL;
1337 }
1338
1339 return result;
1340 }
1341
1342 #if INCLUDE_CDS
1343 char* ClassLoader::skip_uri_protocol(char* source) {
1344 if (strncmp(source, "file:", 5) == 0) {
1345 // file: protocol path could start with file:/ or file:///
1346 // locate the char after all the forward slashes
1347 int offset = 5;
1348 while (*(source + offset) == '/') {
1349 offset++;
1350 }
|