7200493: Improve cache handling
authormalenkov
Mon, 15 Oct 2012 19:00:13 +0400
changeset 16072 6e0f33f8f99d
parent 16071 8b0a4953189c
child 16073 da699ce2f8d2
7200493: Improve cache handling Reviewed-by: art, ahgross
jdk/src/share/classes/com/sun/beans/finder/MethodFinder.java
--- a/jdk/src/share/classes/com/sun/beans/finder/MethodFinder.java	Mon Oct 15 07:42:18 2012 -0700
+++ b/jdk/src/share/classes/com/sun/beans/finder/MethodFinder.java	Mon Oct 15 19:00:13 2012 +0400
@@ -66,11 +66,14 @@
         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;
     }