mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8256167: Convert JDK use of Reference::get
to Reference::refersTo
Reviewed-by: sspitsyn, shade, dfuchs, alanb, kbarrett
This commit is contained in:
parent
78be334c38
commit
972bc3b408
12 changed files with 49 additions and 53 deletions
|
@ -642,7 +642,7 @@ public class AccessibleObject implements AnnotatedElement {
|
|||
}
|
||||
|
||||
boolean isCacheFor(Class<?> caller, Class<?> refc) {
|
||||
return callerRef.get() == caller && targetRef.get() == refc;
|
||||
return callerRef.refersTo(caller) && targetRef.refersTo(refc);
|
||||
}
|
||||
|
||||
static Object protectedMemberCallerCache(Class<?> caller, Class<?> refc) {
|
||||
|
@ -674,7 +674,7 @@ public class AccessibleObject implements AnnotatedElement {
|
|||
if (cache instanceof WeakReference) {
|
||||
@SuppressWarnings("unchecked")
|
||||
WeakReference<Class<?>> ref = (WeakReference<Class<?>>) cache;
|
||||
return ref.get() == caller;
|
||||
return ref.refersTo(caller);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue