connector/src/main/java/org/jboss/as/connector/util/SecurityActions.java
static Constructor<?> getConstructor(final Class<?> c, final Class<?>... params)
            throws NoSuchMethodException {
        if (System.getSecurityManager() == null)
            return c.getConstructor(params);

        Constructor<?> result = AccessController.doPrivileged(new PrivilegedAction<Constructor<?>>() {
            public Constructor<?> run() {
                try {
                    return c.getConstructor(params);
                } catch (NoSuchMethodException e) {
                    return null;
                }
            }
        });

        if (result != null)
            return result;

        throw new NoSuchMethodException();
    }
static Constructor<?> getConstructor(final Class<?> c, final Class<?>... params)
            throws NoSuchMethodException {
        if (System.getSecurityManager() == null)
            return c.getConstructor(params);

        Constructor<?> result = AccessController.doPrivileged(new PrivilegedAction<Constructor<?>>() {
            public Constructor<?> run() {
                try {
                    return c.getConstructor(params);
                } catch (NoSuchMethodException e) {
                    return null;
                }
            }
        });

        if (result != null)
            return result;

        throw new NoSuchMethodException();
    }
static Constructor < ? > getConstructor ( final Class < ? > c , final Class < ? > ... params ) throws NoSuchMethodException { if ( System . getSecurityManager ( ) == null ) return c . getConstructor ( params ) ; Constructor < ? > result = AccessController . doPrivileged ( new PrivilegedAction < Constructor < ? > > ( ) { public Constructor < ? > run ( ) { try { return c . getConstructor ( params ) ; } catch ( NoSuchMethodException e ) { return null ; } } } ) ; if ( result != null ) return result ; throw new NoSuchMethodException ( ) ; }
Get the constructor

@param c      The class
@param params The parameters
@return The constructor
@throws NoSuchMethodException If a matching method is not found.
Get the constructor