loginmodules/password/pwcommon/src/main/java/org/beiter/michael/authn/jaas/loginmodules/password/common/PasswordLoginModule.java
private void initPwValidator(final CommonProperties commonProps) {
        try {
            final String validatorClass = commonProps.getPasswordValidatorClassName();
            if (validatorClass == null) {
                final String error = "No password validator class has been configured in the JAAS configuration";
                LOG.error(error);
                throw new IllegalStateException(error);
            } else {
                if (commonProps.isPasswordValidatorSingleton()) {
                    // Fortify will report a violation here because of disclosure of potentially confidential
                    // information. However, the class name is not confidential, which makes this a non-issue / false
                    // positive.
                    LOG.debug("Requesting singleton validator class instance of '" + validatorClass
                            + "' from the validator factory");
                    this.pwValidator = PasswordValidatorFactory.getSingleton(validatorClass, commonProps);
                } else {
                    // Fortify will report a violation here because of disclosure of potentially confidential
                    // information. However, the class name is not confidential, which makes this a non-issue / false
                    // positive.
                    LOG.debug("Requesting non-singleton validator class instance of '" + validatorClass
                            + "' from the validator factory");
                    this.pwValidator = PasswordValidatorFactory.getInstance(validatorClass, commonProps);
                }
            }
        } catch (FactoryException e) {
            final String error = "The validator class cannot be instantiated. This is most likely a configuration"
                    + " problem. Is the configured class available in the classpath?";
            LOG.error(error, e);
            throw new IllegalStateException(error, e);
        }
    }
private void initPwValidator(final CommonProperties commonProps) {
        try {
            final String validatorClass = commonProps.getPasswordValidatorClassName();
            if (validatorClass == null) {
                final String error = "No password validator class has been configured in the JAAS configuration";
                LOG.error(error);
                throw new IllegalStateException(error);
            } else {
                if (commonProps.isPasswordValidatorSingleton()) {
                    // Fortify will report a violation here because of disclosure of potentially confidential
                    // information. However, the class name is not confidential, which makes this a non-issue / false
                    // positive.
                    LOG.debug("Requesting singleton validator class instance of '" + validatorClass
                            + "' from the validator factory");
                    this.pwValidator = PasswordValidatorFactory.getSingleton(validatorClass, commonProps);
                } else {
                    // Fortify will report a violation here because of disclosure of potentially confidential
                    // information. However, the class name is not confidential, which makes this a non-issue / false
                    // positive.
                    LOG.debug("Requesting non-singleton validator class instance of '" + validatorClass
                            + "' from the validator factory");
                    this.pwValidator = PasswordValidatorFactory.getInstance(validatorClass, commonProps);
                }
            }
        } catch (FactoryException e) {
            final String error = "The validator class cannot be instantiated. This is most likely a configuration"
                    + " problem. Is the configured class available in the classpath?";
            LOG.error(error, e);
            throw new IllegalStateException(error, e);
        }
    }
Initialize the instance-global password validator object

@param commonProps The parsed JAAS configuration, plus additional raw values