# HG changeset patch # User mchung # Date 1366225455 25200 # Node ID 50bfa0defec213ce53a4a980a35463af1f30b0f9 # Parent 6c918c9728506b24a26ba6b4d38880cb6d0ce0de 8004260: dynamic proxy class should have the same Java language access as the proxy interfaces Reviewed-by: alanb, jrose, jdn diff -r 6c918c972850 -r 50bfa0defec2 jdk/src/share/classes/java/lang/reflect/Proxy.java --- a/jdk/src/share/classes/java/lang/reflect/Proxy.java Wed Apr 17 11:39:52 2013 -0700 +++ b/jdk/src/share/classes/java/lang/reflect/Proxy.java Wed Apr 17 12:04:15 2013 -0700 @@ -28,7 +28,6 @@ import java.lang.ref.Reference; import java.lang.ref.WeakReference; import java.security.AccessController; -import java.security.Permission; import java.security.PrivilegedAction; import java.util.Arrays; import java.util.Collections; @@ -53,16 +52,14 @@ *

To create a proxy for some interface {@code Foo}: *

  *     InvocationHandler handler = new MyInvocationHandler(...);
- *     Class proxyClass = Proxy.getProxyClass(
- *         Foo.class.getClassLoader(), new Class[] { Foo.class });
- *     Foo f = (Foo) proxyClass.
- *         getConstructor(new Class[] { InvocationHandler.class }).
- *         newInstance(new Object[] { handler });
+ *     Class<?> proxyClass = Proxy.getProxyClass(Foo.class.getClassLoader(), Foo.class);
+ *     Foo f = (Foo) proxyClass.getConstructor(InvocationHandler.class).
+ *                     newInstance(handler);
  * 
* or more simply: *
  *     Foo f = (Foo) Proxy.newProxyInstance(Foo.class.getClassLoader(),
- *                                          new Class[] { Foo.class },
+ *                                          new Class<?>[] { Foo.class },
  *                                          handler);
  * 
* @@ -91,7 +88,11 @@ *

A proxy class has the following properties: * *