@Override public void validatePassword(char[] password) throws PasswordPolicyException { // if (password==null) // throw createSecurityException(PW_IS_NULL); if (password == null) { // treat as "empty" password = new char[] {}; } if (password.length < config.getMinLength()) throw createSecurityException(MIN_LENGTH_$1, config.getMinLength()); if (config.getMaxLength() >= 0 && password.length > config.getMaxLength()) throw createSecurityException(MAX_LENGTH_$1, config.getMaxLength()); if (config.isDigitRequired()) { if (checkUsingMethod("isDigit", password) == false) throw createSecurityException(NO_DIGIT); } if (config.isUppercaseRequired()) { if (checkUsingMethod("isUpperCase", password) == false) throw createSecurityException(NO_UPPERCASE); } if (config.isLowercaseRequired()) { if (checkUsingMethod("isLowerCase", password) == false) throw createSecurityException(NO_LOWERCASE); } String prefix = passwordStartsWithEncoderPrefix(password); if (prefix != null) throw createSecurityException(RESERVED_PREFIX_$1, prefix); }