Program: 167278
Project: 167278
Buggy source:
protected static boolean testPassword(PasswordField passwordField,PasswordField validatePasswordField,ApplicationContext context){
  boolean passedTest=true;
  if (validatePasswordField.getValue() == null || passwordField.getValue() == null || !validatePasswordField.getValue().equals(passwordField.getValue())) {
    notify("String_Node_Str","String_Node_Str");
    passedTest=false;
  }
 else {
    TypedProperties settings=new TypedProperties();
    settings.putAll(context.getOperationsSerivce().findGlobalSettingsAsMap());
    ISecurityService securityService=context.getSecurityService();
    int minPasswordLength=settings.getInt(PASSWORD_MIN_LENGTH,6);
    if (passwordField.getValue().length() < minPasswordLength) {
      passedTest=false;
      notify("String_Node_Str","String_Node_Str" + minPasswordLength + "String_Node_Str");
    }
    int prohibitNPreviousPasswords=settings.getInt(PASSWORD_PROHIBIT_PREVIOUS,5);
    if (passedTest && prohibitNPreviousPasswords != 0) {
      List<UserHist> histories=context.getOperationsSerivce().findUserHist(context.getUser().getId());
      if (prohibitNPreviousPasswords < 0) {
        prohibitNPreviousPasswords=histories.size();
      }
      for (int i=0; i < histories.size() && i < prohibitNPreviousPasswords; i++) {
        UserHist hist=histories.get(i);
        String toCompare=securityService.hash(hist.getSalt(),passwordField.getValue());
        if (toCompare.equals(hist.getPassword())) {
          passedTest=false;
          notify("String_Node_Str","String_Node_Str");
          break;
        }
      }
    }
    if (passedTest) {
      boolean requiresAlphaNumberic=settings.is(PASSWORD_REQUIRE_ALPHANUMERIC,true);
      if (requiresAlphaNumberic && !containsAlphanumeric(passwordField.getValue())) {
        passedTest=false;
        notify("String_Node_Str","String_Node_Str");
      }
    }
    if (passedTest) {
      boolean requiresSymbol=settings.is(PASSWORD_REQUIRE_SYMBOL,true);
      if (requiresSymbol && !containsSymbol(passwordField.getValue())) {
        passedTest=false;
        notify("String_Node_Str","String_Node_Str");
      }
    }
    if (passedTest) {
      boolean requiresMixedCase=settings.is(PASSWORD_REQUIRE_MIXED_CASE,true);
      if (requiresMixedCase && !containsMixedCase(passwordField.getValue())) {
        passedTest=false;
        notify("String_Node_Str","String_Node_Str");
      }
    }
    if (passedTest) {
      boolean prohibitCommonWords=settings.is(PASSWORD_PROHIBIT_COMMON_WORDS,true);
      if (prohibitCommonWords && containsCommonWords(passwordField.getValue())) {
        passedTest=false;
        notify("String_Node_Str","String_Node_Str");
      }
    }
  }
  return passedTest;
}

Fixed version (ground truth):
protected static boolean testPassword(PasswordField passwordField,PasswordField validatePasswordField,ApplicationContext context){
  boolean passedTest=true;
  if (validatePasswordField.getValue() == null || passwordField.getValue() == null || !validatePasswordField.getValue().equals(passwordField.getValue())) {
    notify("String_Node_Str","String_Node_Str");
    passedTest=false;
  }
 else {
    TypedProperties settings=new TypedProperties();
    settings.putAll(context.getOperationsService().findGlobalSettingsAsMap());
    ISecurityService securityService=context.getSecurityService();
    int minPasswordLength=settings.getInt(PASSWORD_MIN_LENGTH,6);
    if (passwordField.getValue().length() < minPasswordLength) {
      passedTest=false;
      notify("String_Node_Str","String_Node_Str" + minPasswordLength + "String_Node_Str");
    }
    int prohibitNPreviousPasswords=settings.getInt(PASSWORD_PROHIBIT_PREVIOUS,5);
    if (passedTest && prohibitNPreviousPasswords != 0) {
      List<UserHist> histories=context.getOperationsService().findUserHist(context.getUser().getId());
      if (prohibitNPreviousPasswords < 0) {
        prohibitNPreviousPasswords=histories.size();
      }
      for (int i=0; i < histories.size() && i < prohibitNPreviousPasswords; i++) {
        UserHist hist=histories.get(i);
        String toCompare=securityService.hash(hist.getSalt(),passwordField.getValue());
        if (toCompare.equals(hist.getPassword())) {
          passedTest=false;
          notify("String_Node_Str","String_Node_Str");
          break;
        }
      }
    }
    if (passedTest) {
      boolean requiresAlphaNumberic=settings.is(PASSWORD_REQUIRE_ALPHANUMERIC,true);
      if (requiresAlphaNumberic && !containsAlphanumeric(passwordField.getValue())) {
        passedTest=false;
        notify("String_Node_Str","String_Node_Str");
      }
    }
    if (passedTest) {
      boolean requiresSymbol=settings.is(PASSWORD_REQUIRE_SYMBOL,true);
      if (requiresSymbol && !containsSymbol(passwordField.getValue())) {
        passedTest=false;
        notify("String_Node_Str","String_Node_Str");
      }
    }
    if (passedTest) {
      boolean requiresMixedCase=settings.is(PASSWORD_REQUIRE_MIXED_CASE,true);
      if (requiresMixedCase && !containsMixedCase(passwordField.getValue())) {
        passedTest=false;
        notify("String_Node_Str","String_Node_Str");
      }
    }
    if (passedTest) {
      boolean prohibitCommonWords=settings.is(PASSWORD_PROHIBIT_COMMON_WORDS,true);
      if (prohibitCommonWords && containsCommonWords(passwordField.getValue())) {
        passedTest=false;
        notify("String_Node_Str","String_Node_Str");
      }
    }
  }
  return passedTest;
}