changeset 5556:7a4e2abdd290

7200493: Improve cache handling Reviewed-by: art, ahgross
author malenkov
date Mon, 15 Oct 2012 14:06:54 +0400
parents 40a9d9706e35
children b09d649c1b88
files src/share/classes/com/sun/beans/finder/MethodFinder.java
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/beans/finder/MethodFinder.java	Tue Nov 06 17:49:01 2012 +0400
+++ b/src/share/classes/com/sun/beans/finder/MethodFinder.java	Mon Oct 15 14:06:54 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;
     }