< prev index next >

src/hotspot/share/classfile/systemDictionaryShared.cpp

Print this page
rev 58452 : imported patch pkg_name_from_class

*** 441,453 **** } Handle SystemDictionaryShared::get_package_name(Symbol* class_name, TRAPS) { ResourceMark rm(THREAD); Handle pkgname_string; ! char* pkgname = (char*) ClassLoader::package_from_name((const char*) class_name->as_C_string()); ! if (pkgname != NULL) { // Package prefix found ! StringUtils::replace_no_expand(pkgname, "/", "."); pkgname_string = java_lang_String::create_from_str(pkgname, CHECK_(pkgname_string)); } return pkgname_string; } --- 441,453 ---- } Handle SystemDictionaryShared::get_package_name(Symbol* class_name, TRAPS) { ResourceMark rm(THREAD); Handle pkgname_string; ! Symbol* pkg = InstanceKlass::package_from_name(class_name); ! if (pkg != NULL) { // Package prefix found ! const char* pkgname = pkg->as_klass_external_name(); pkgname_string = java_lang_String::create_from_str(pkgname, CHECK_(pkgname_string)); } return pkgname_string; }
*** 600,610 **** // for fast access by the VM. ResourceMark rm; ClassLoaderData *loader_data = ClassLoaderData::class_loader_data(class_loader()); PackageEntryTable* pkgEntryTable = loader_data->packages(); ! TempNewSymbol pkg_name = InstanceKlass::package_from_name(class_name, CHECK_(pd)); if (pkg_name != NULL) { PackageEntry* pkg_entry = pkgEntryTable->lookup_only(pkg_name); if (pkg_entry != NULL) { ModuleEntry* mod_entry = pkg_entry->module(); pd = get_shared_protection_domain(class_loader, mod_entry, THREAD); --- 600,610 ---- // for fast access by the VM. ResourceMark rm; ClassLoaderData *loader_data = ClassLoaderData::class_loader_data(class_loader()); PackageEntryTable* pkgEntryTable = loader_data->packages(); ! TempNewSymbol pkg_name = InstanceKlass::package_from_name(class_name); if (pkg_name != NULL) { PackageEntry* pkg_entry = pkgEntryTable->lookup_only(pkg_name); if (pkg_entry != NULL) { ModuleEntry* mod_entry = pkg_entry->module(); pd = get_shared_protection_domain(class_loader, mod_entry, THREAD);
< prev index next >