private RegistrationResult checkPassword(String password,String confirmPassword){
  if ((password == null) || password.length() == 0) {
    if (debug.messageEnabled()) {
      debug.message("password was missing from the form");
    }
    return RegistrationResult.NO_PASSWORD_ERROR;
  }
 else {
    if (password.length() < requiredPasswordLength) {
      if (debug.messageEnabled()) {
        debug.message("password was not long enough");
      }
      return RegistrationResult.PASSWORD_TOO_SHORT;
    }
    if ((confirmPassword == null) || confirmPassword.length() == 0) {
      if (debug.messageEnabled()) {
        debug.message("no confirmation password");
      }
      return RegistrationResult.NO_CONFIRMATION_ERROR;
    }
 else {
      if (!password.equals(confirmPassword)) {
        return RegistrationResult.PASSWORD_MISMATCH_ERROR;
      }
    }
  }
  return RegistrationResult.NO_ERROR;
}

private RegistrationResult checkPassword ( String password , String confirmPassword ) { if ( ( password == null ) || password . length ( ) == 0 ) { if ( debug . messageEnabled ( ) ) { debug . message ( "password was missing from the form" ) ; } return RegistrationResult . NO_PASSWORD_ERROR ; } else { if ( password . length ( ) < requiredPasswordLength ) { if ( debug . messageEnabled ( ) ) { debug . message ( "password was not long enough" ) ; } return RegistrationResult . PASSWORD_TOO_SHORT ; } if ( ( confirmPassword == null ) || confirmPassword . length ( ) == 0 ) { if ( debug . messageEnabled ( ) ) { debug . message ( "no confirmation password" ) ; } return RegistrationResult . NO_CONFIRMATION_ERROR ; } else { if ( ! password . equals ( confirmPassword ) ) { return RegistrationResult . PASSWORD_MISMATCH_ERROR ; } } } return RegistrationResult . NO_ERROR ; }
checks the passwords and returned error state or succeeded if the passwords are valid .
