7200493: Improve cache handling

Reviewed-by: art, ahgross
This commit is contained in:
Sergey Malenkov 2012-10-15 19:00:13 +04:00
parent f36ef09388
commit c4f31fd22e

View File

@ -66,11 +66,14 @@ public final class MethodFinder extends AbstractFinder<Method> {
Signature signature = new Signature(type, name, args);
Method method = CACHE.get(signature);
if (method != null) {
boolean cached = method != null;
if (cached && isPackageAccessible(method.getDeclaringClass())) {
return method;
}
method = findAccessibleMethod(new MethodFinder(name, args).find(type.getMethods()));
CACHE.put(signature, method);
if (!cached) {
CACHE.put(signature, method);
}
return method;
}