<Beans Dev> [9] Review Request: 8130061 java.beans.EventHandler.create does not specify how it fails when an EventHandler cannot be created

Alan Bateman Alan.Bateman at oracle.com
Thu Feb 11 15:52:41 UTC 2016



On 11/02/2016 15:49, Sergey Bylokhov wrote:
>
> The Proxy.newProxyInstance() has not the description of why the 
> IllegalArgumentException can be thrown, it points to 
> Proxy.getProxyClass():
>
>      * <p>{@code Proxy.newProxyInstance} throws
>      * {@code IllegalArgumentException} for the same reasons that
>      * {@code Proxy.getProxyClass} does.
> ......
>      * @throws  IllegalArgumentException if any of the restrictions on 
> the
>      *          parameters that may be passed to {@code getProxyClass}
>      *          are violated
>     public static Object newProxyInstance(ClassLoader loader,
>                                           Class<?>[] interfaces,
>                                           InvocationHandler h)
>
>
Proxy.getProxyClass is proposed to be deprecated in Java SE 9 - you'll 
see the changes in the jake forest, they just haven't got to JDK 9 main 
line yet. There is also a very clear list of restrictions in the updated 
javadoc. Since you are going into jdk9/client then maybe the simplest is 
to just reference the restrictions in the Proxy class.

-Alan



More information about the beans-dev mailing list