changeset 7287:81353e2baf81

8035009: Make Proxy representations consistent Reviewed-by: ahgross, jfranck
author igerasim
date Tue, 04 Mar 2014 23:56:51 +0400
parents 1dfbfad6c921
children 177d11da2566
files src/share/classes/java/lang/reflect/Proxy.java
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/lang/reflect/Proxy.java	Mon Mar 03 09:21:16 2014 -0800
+++ b/src/share/classes/java/lang/reflect/Proxy.java	Tue Mar 04 23:56:51 2014 +0400
@@ -396,12 +396,13 @@
                                          Class<?>... interfaces)
         throws IllegalArgumentException
     {
-        SecurityManager sm = System.getSecurityManager();
+        final Class<?>[] intfs = interfaces.clone();
+        final SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            checkProxyAccess(Reflection.getCallerClass(), loader, interfaces);
+            checkProxyAccess(Reflection.getCallerClass(), loader, intfs);
         }
 
-        return getProxyClass0(loader, interfaces);
+        return getProxyClass0(loader, intfs);
     }
 
     /*
@@ -725,15 +726,16 @@
             throw new NullPointerException();
         }
 
+        final Class<?>[] intfs = interfaces.clone();
         final SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            checkProxyAccess(Reflection.getCallerClass(), loader, interfaces);
+            checkProxyAccess(Reflection.getCallerClass(), loader, intfs);
         }
 
         /*
          * Look up or generate the designated proxy class.
          */
-        Class<?> cl = getProxyClass0(loader, interfaces);
+        Class<?> cl = getProxyClass0(loader, intfs);
 
         /*
          * Invoke its constructor with the designated invocation handler.