< prev index next >
src/java.base/share/classes/sun/invoke/util/VerifyAccess.java
Print this page
@@ -234,11 +234,11 @@
* reference of a given reference class, is really visible to that class.
* @param type the supposed type of a member or symbolic reference of refc
* @param refc the class attempting to make the reference
*/
public static boolean isTypeVisible(Class<?> type, Class<?> refc) {
- if (type == refc) {
+ if (type.asBoxType() == refc.asBoxType()) {
return true; // easy check
}
while (type.isArray()) type = type.getComponentType();
if (type.isPrimitive() || type == Object.class) {
return true;
@@ -293,11 +293,11 @@
} catch (ClassNotFoundException | LinkageError e) {
return null; // Assume the class is not found
}
}
});
- return (type == res);
+ return (type.asBoxType() == res);
}
/**
* Decide if the given method type, attributed to a member or symbolic
* reference of a given reference class, is really visible to that class.
< prev index next >