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