public static Constructor getConstructor(final String name) throws ClassNotFoundException, NoSuchMethodException {
        var constructor = constructorsCache.get(name);
        if (constructor == null) {
            synchronized (constructorsCache) {
                constructor = constructorsCache.get(name);
                if (constructor == null) {
                    Class<?> clazz;
                    try {
                        clazz = Class.forName(name, true, CommonHelper.class.getClassLoader());
                    } catch (final ClassNotFoundException e) {
                        val tccl = Thread.currentThread().getContextClassLoader();
                        if (tccl == null) {
                            clazz = Class.forName(name);
                        } else {
                            clazz = Class.forName(name, true, tccl);
                        }
                    }

                    constructor = clazz.getDeclaredConstructor();
                    constructorsCache.put(name, constructor);
                }
            }
        }

        return constructor;
    }
Get the constructor of the class.

@param name the name of the class
@return the constructor
@throws ClassNotFoundException class not found
@throws NoSuchMethodException  method not found
pac4j-core/src/main/java/org/pac4j/core/util/CommonHelper.java