src/hotspot/share/oops/instanceKlass.cpp
changeset 58177 4932dce35882
parent 58084 cddef3bde924
child 58226 408c445d04e8
equal deleted inserted replaced
58176:470af058bd5f 58177:4932dce35882
  2715 
  2715 
  2716   // Same package is determined by comparing class loader
  2716   // Same package is determined by comparing class loader
  2717   // and package entries. Both must be the same. This rule
  2717   // and package entries. Both must be the same. This rule
  2718   // applies even to classes that are defined in the unnamed
  2718   // applies even to classes that are defined in the unnamed
  2719   // package, they still must have the same class loader.
  2719   // package, they still must have the same class loader.
  2720   if (oopDesc::equals(classloader1, classloader2) && (classpkg1 == classpkg2)) {
  2720   if ((classloader1 == classloader2) && (classpkg1 == classpkg2)) {
  2721     return true;
  2721     return true;
  2722   }
  2722   }
  2723 
  2723 
  2724   return false;
  2724   return false;
  2725 }
  2725 }
  2726 
  2726 
  2727 // return true if this class and other_class are in the same package. Classloader
  2727 // return true if this class and other_class are in the same package. Classloader
  2728 // and classname information is enough to determine a class's package
  2728 // and classname information is enough to determine a class's package
  2729 bool InstanceKlass::is_same_class_package(oop other_class_loader,
  2729 bool InstanceKlass::is_same_class_package(oop other_class_loader,
  2730                                           const Symbol* other_class_name) const {
  2730                                           const Symbol* other_class_name) const {
  2731   if (!oopDesc::equals(class_loader(), other_class_loader)) {
  2731   if (class_loader() != other_class_loader) {
  2732     return false;
  2732     return false;
  2733   }
  2733   }
  2734   if (name()->fast_compare(other_class_name) == 0) {
  2734   if (name()->fast_compare(other_class_name) == 0) {
  2735      return true;
  2735      return true;
  2736   }
  2736   }