< prev index next >

src/hotspot/share/classfile/systemDictionary.cpp

Print this page




 426     superk = handle_resolution_exception(class_name, true, superk, THREAD);
 427   }
 428 
 429   return superk;
 430 }
 431 
 432 void SystemDictionary::validate_protection_domain(InstanceKlass* klass,
 433                                                   Handle class_loader,
 434                                                   Handle protection_domain,
 435                                                   TRAPS) {
 436   if(!has_checkPackageAccess()) return;
 437 
 438   // Now we have to call back to java to check if the initating class has access
 439   JavaValue result(T_VOID);
 440   LogTarget(Debug, protectiondomain) lt;
 441   if (lt.is_enabled()) {
 442     ResourceMark rm;
 443     // Print out trace information
 444     LogStream ls(lt);
 445     ls.print_cr("Checking package access");
 446     ls.print("class loader: "); class_loader()->print_value_on(&ls);
 447     ls.print(" protection domain: "); protection_domain()->print_value_on(&ls);










 448     ls.print(" loading: "); klass->print_value_on(&ls);
 449     ls.cr();
 450   }
 451 
 452   // This handle and the class_loader handle passed in keeps this class from
 453   // being unloaded through several GC points.
 454   // The class_loader handle passed in is the initiating loader.
 455   Handle mirror(THREAD, klass->java_mirror());
 456 
 457   InstanceKlass* system_loader = SystemDictionary::ClassLoader_klass();
 458   JavaCalls::call_special(&result,
 459                          class_loader,
 460                          system_loader,
 461                          vmSymbols::checkPackageAccess_name(),
 462                          vmSymbols::class_protectiondomain_signature(),
 463                          mirror,
 464                          protection_domain,
 465                          THREAD);
 466 
 467   if (HAS_PENDING_EXCEPTION) {




 426     superk = handle_resolution_exception(class_name, true, superk, THREAD);
 427   }
 428 
 429   return superk;
 430 }
 431 
 432 void SystemDictionary::validate_protection_domain(InstanceKlass* klass,
 433                                                   Handle class_loader,
 434                                                   Handle protection_domain,
 435                                                   TRAPS) {
 436   if(!has_checkPackageAccess()) return;
 437 
 438   // Now we have to call back to java to check if the initating class has access
 439   JavaValue result(T_VOID);
 440   LogTarget(Debug, protectiondomain) lt;
 441   if (lt.is_enabled()) {
 442     ResourceMark rm;
 443     // Print out trace information
 444     LogStream ls(lt);
 445     ls.print_cr("Checking package access");
 446     if (class_loader() != NULL) {
 447       ls.print("class loader: ");
 448       class_loader()->print_value_on(&ls);
 449     } else {
 450       ls.print_cr("class loader: NULL");
 451     }
 452     if (protection_domain() != NULL) {
 453       ls.print(" protection domain: ");
 454       protection_domain()->print_value_on(&ls);
 455     } else {
 456       ls.print_cr(" protection domain: NULL");
 457     }
 458     ls.print(" loading: "); klass->print_value_on(&ls);
 459     ls.cr();
 460   }
 461 
 462   // This handle and the class_loader handle passed in keeps this class from
 463   // being unloaded through several GC points.
 464   // The class_loader handle passed in is the initiating loader.
 465   Handle mirror(THREAD, klass->java_mirror());
 466 
 467   InstanceKlass* system_loader = SystemDictionary::ClassLoader_klass();
 468   JavaCalls::call_special(&result,
 469                          class_loader,
 470                          system_loader,
 471                          vmSymbols::checkPackageAccess_name(),
 472                          vmSymbols::class_protectiondomain_signature(),
 473                          mirror,
 474                          protection_domain,
 475                          THREAD);
 476 
 477   if (HAS_PENDING_EXCEPTION) {


< prev index next >