equal
deleted
inserted
replaced
2399 |
2399 |
2400 // Same package is determined by comparing class loader |
2400 // Same package is determined by comparing class loader |
2401 // and package entries. Both must be the same. This rule |
2401 // and package entries. Both must be the same. This rule |
2402 // applies even to classes that are defined in the unnamed |
2402 // applies even to classes that are defined in the unnamed |
2403 // package, they still must have the same class loader. |
2403 // package, they still must have the same class loader. |
2404 if ((classloader1 == classloader2) && (classpkg1 == classpkg2)) { |
2404 if (oopDesc::equals(classloader1, classloader2) && (classpkg1 == classpkg2)) { |
2405 return true; |
2405 return true; |
2406 } |
2406 } |
2407 |
2407 |
2408 return false; |
2408 return false; |
2409 } |
2409 } |
2410 |
2410 |
2411 // return true if this class and other_class are in the same package. Classloader |
2411 // return true if this class and other_class are in the same package. Classloader |
2412 // and classname information is enough to determine a class's package |
2412 // and classname information is enough to determine a class's package |
2413 bool InstanceKlass::is_same_class_package(oop other_class_loader, |
2413 bool InstanceKlass::is_same_class_package(oop other_class_loader, |
2414 const Symbol* other_class_name) const { |
2414 const Symbol* other_class_name) const { |
2415 if (class_loader() != other_class_loader) { |
2415 if (!oopDesc::equals(class_loader(), other_class_loader)) { |
2416 return false; |
2416 return false; |
2417 } |
2417 } |
2418 if (name()->fast_compare(other_class_name) == 0) { |
2418 if (name()->fast_compare(other_class_name) == 0) { |
2419 return true; |
2419 return true; |
2420 } |
2420 } |