changeset 7958:24a3eb2f0553

7200493: Improve cache handling Reviewed-by: art, ahgross
author malenkov
date Mon, 15 Oct 2012 19:00:13 +0400
parents 85bf51db473c
children c7c39320bc6c
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	Mon Oct 15 07:42:18 2012 -0700
+++ b/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;
     }