changeset 25533:95f7f4b0bb93

8035009: Make Proxy representations consistent Reviewed-by: ahgross, jfranck
author mchung
date Mon, 03 Mar 2014 14:14:10 -0800
parents 6f9d3cf6ca39
children 27caad43f846
files jdk/src/share/classes/java/lang/reflect/Proxy.java
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/share/classes/java/lang/reflect/Proxy.java	Thu Apr 24 20:58:00 2014 +0400
+++ b/jdk/src/share/classes/java/lang/reflect/Proxy.java	Mon Mar 03 14:14:10 2014 -0800
@@ -362,12 +362,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);
     }
 
     /*
@@ -706,15 +707,16 @@
     {
         Objects.requireNonNull(h);
 
+        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.