@CallerSensitive
    public static Object newProxyInstance(ClassLoader loader,
                                          Class<?>[] interfaces,
                                          InvocationHandler h)
        throws IllegalArgumentException
    {
        if (h == null) {
            throw new NullPointerException();
        }

        /*
         * Look up or generate the designated proxy class.
         */
        Class<?> cl = getProxyClass0(loader, interfaces);

        /*
         * Invoke its constructor with the designated invocation handler.
         */
        try {
            final Constructor<?> cons = cl.getConstructor(constructorParams);
            return newInstance(cons, h);
        } catch (NoSuchMethodException e) {
            throw new InternalError(e.toString());
        }
    }
@ CallerSensitive public static Object newProxyInstance ( ClassLoader loader , Class < ? > [ ] interfaces , InvocationHandler h ) throws IllegalArgumentException { if ( h == null ) { throw new NullPointerException ( ) ; } Class < ? > cl = getProxyClass0 ( loader , interfaces ) ; try { final Constructor < ? > cons = cl . getConstructor ( constructorParams ) ; return newInstance ( cons , h ) ; } catch ( NoSuchMethodException e ) { throw new InternalError ( e . toString ( ) ) ; } }
Returns an instance of a proxy class for the specified interfaces
that dispatches method invocations to the specified invocation
handler.  This method is equivalent to:
<pre>
Proxy.getProxyClass(loader, interfaces).
getConstructor(new Class[] { InvocationHandler.class }).
newInstance(new Object[] { handler });
</pre>

<p>{@code Proxy.newProxyInstance} throws
{@code IllegalArgumentException} for the same reasons that
{@code Proxy.getProxyClass} does.

@param   loader the class loader to define the proxy class
@param   interfaces the list of interfaces for the proxy class
to implement
@param   h the invocation handler to dispatch method invocations to
@return  a proxy instance with the specified invocation handler of a
proxy class that is defined by the specified class loader
and that implements the specified interfaces
@throws  IllegalArgumentException if any of the restrictions on the
parameters that may be passed to {@code getProxyClass}
are violated
@throws  NullPointerException if the {@code interfaces} array
argument or any of its elements are {@code null}, or
if the invocation handler, {@code h}, is
{@code null}