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

        Method result = AccessController.doPrivileged(new PrivilegedAction<Method>() {
            public Method run() {
                try {
                    return c.getMethod(name, params);
                } catch (NoSuchMethodException e) {
                    return null;
                }
            }
        });

        if (result != null)
            return result;

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

        Method result = AccessController.doPrivileged(new PrivilegedAction<Method>() {
            public Method run() {
                try {
                    return c.getMethod(name, params);
                } catch (NoSuchMethodException e) {
                    return null;
                }
            }
        });

        if (result != null)
            return result;

        throw new NoSuchMethodException();
    }
Get the method

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