# HG changeset patch # User mchung # Date 1366225455 25200 # Node ID 73e3b474125e1ab99cff0fa02d18d819e122f320 # Parent d9f9040554d6f0f2ea31d6d4a8a16731d87bde43 8004260: dynamic proxy class should have the same Java language access as the proxy interfaces Reviewed-by: alanb, jrose, jdn diff -r d9f9040554d6 -r 73e3b474125e src/share/classes/java/lang/reflect/Proxy.java --- a/src/share/classes/java/lang/reflect/Proxy.java Wed Apr 17 11:39:52 2013 -0700 +++ b/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: * *