public static Constructor<?> getConstructor(final Class<?> clazz,
        final Class<?>... argumentTypes) throws NoSuchMethodException {
        try {
            return AccessController
                .doPrivileged(new PrivilegedExceptionAction<Constructor<?>>() {
                    public Constructor<?> run()
                        throws NoSuchMethodException {
                        return clazz.getConstructor(argumentTypes);
                    }
                });
        }
        // Unwrap
        catch (final PrivilegedActionException pae) {
            final Throwable t = pae.getCause();
            // Rethrow
            if (t instanceof NoSuchMethodException) {
                throw (NoSuchMethodException) t;
            } else {
                // No other checked Exception thrown by Class.getConstructor
                try {
                    throw (RuntimeException) t;
                }
                // Just in case we've really messed up
                catch (final ClassCastException cce) {
                    throw new RuntimeException(
                        "Obtained unchecked Exception; this code should never be reached",
                        t);
                }
            }
        }
    }
public static Constructor < ? > getConstructor ( final Class < ? > clazz , final Class < ? > ... argumentTypes ) throws NoSuchMethodException { try { return AccessController . doPrivileged ( new PrivilegedExceptionAction < Constructor < ? > > ( ) { public Constructor < ? > run ( ) throws NoSuchMethodException { return clazz . getConstructor ( argumentTypes ) ; } } ) ; } catch ( final PrivilegedActionException pae ) { final Throwable t = pae . getCause ( ) ; if ( t instanceof NoSuchMethodException ) { throw ( NoSuchMethodException ) t ; } else { try { throw ( RuntimeException ) t ; } catch ( final ClassCastException cce ) { throw new RuntimeException ( "Obtained unchecked Exception; this code should never be reached" , t ) ; } } } }
Obtains the Constructor specified from the given Class and argument types

@throws NoSuchMethodException