< prev index next >
src/java.base/share/classes/sun/invoke/util/VerifyAccess.java
Print this page
*** 349,366 ****
* If this is true, they can share private access with each other.
* @param class1 a class
* @param class2 another class
* @return whether they are identical or nested together
*/
! public static boolean areNestMates(Class<?> class1, Class<?> class2) {
if (class1 == class2)
return true;
if (!isSamePackage(class1, class2))
return false;
- if (Reflection.areNestMates(class1, class2))
- return true;
- // Could be pre-nestmate nested types
if (getOutermostEnclosingClass(class1) != getOutermostEnclosingClass(class2))
return false;
return true;
}
--- 349,363 ----
* If this is true, they can share private access with each other.
* @param class1 a class
* @param class2 another class
* @return whether they are identical or nested together
*/
! public static boolean isSamePackageMember(Class<?> class1, Class<?> class2) {
if (class1 == class2)
return true;
if (!isSamePackage(class1, class2))
return false;
if (getOutermostEnclosingClass(class1) != getOutermostEnclosingClass(class2))
return false;
return true;
}
< prev index next >