changeset 6683:c378b877f5b6

8017291: Cast Proxies Aside Reviewed-by: alanb, ahgross
author mchung
date Mon, 15 Jul 2013 03:40:16 -0700
parents 390752a9e4ee
children 328d974d2eb8
files src/share/classes/java/lang/ClassLoader.java
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/lang/ClassLoader.java	Wed Jul 10 15:28:42 2013 -0700
+++ b/src/share/classes/java/lang/ClassLoader.java	Mon Jul 15 03:40:16 2013 -0700
@@ -58,6 +58,7 @@
 import sun.misc.VM;
 import sun.reflect.CallerSensitive;
 import sun.reflect.Reflection;
+import sun.reflect.misc.ReflectUtil;
 import sun.security.util.SecurityConstants;
 
 /**
@@ -487,6 +488,13 @@
     private void checkPackageAccess(Class cls, ProtectionDomain pd) {
         final SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
+            if (ReflectUtil.isNonPublicProxyClass(cls)) {
+                for (Class intf: cls.getInterfaces()) {
+                    checkPackageAccess(intf, pd);
+                }
+                return;
+            }
+
             final String name = cls.getName();
             final int i = name.lastIndexOf('.');
             if (i != -1) {