Program: 178662
Project: 178662
Buggy source:
public Result evaluateBuildResult(final BuildListener listener,int errorsCount,int newErrorsCount,KloConfig kloConfig,Map<String,String> matrixBuildVars){
  String failureThreshold=kloConfig.getConfigSeverityEvaluation().getFailureThreshold();
  String newFailureThreshold=kloConfig.getConfigSeverityEvaluation().getNewFailureThreshold();
  String unstableThreshold=kloConfig.getConfigSeverityEvaluation().getThreshold();
  String newUnstableThreshold=kloConfig.getConfigSeverityEvaluation().getNewThreshold();
  if (matrixBuildVars != null) {
    Iterator it=matrixBuildVars.entrySet().iterator();
    while (it.hasNext()) {
      Map.Entry pairs=(Map.Entry)it.next();
      if (failureThreshold.contains("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str")) {
        failureThreshold=failureThreshold.replace("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str",pairs.getValue().toString());
      }
      if (failureThreshold.contains("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str")) {
        failureThreshold=failureThreshold.replace("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str",pairs.getValue().toString());
      }
      if (failureThreshold.contains("String_Node_Str" + pairs.getKey().toString())) {
        failureThreshold=failureThreshold.replace("String_Node_Str" + pairs.getKey().toString(),pairs.getValue().toString());
      }
      if (newFailureThreshold.contains("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str")) {
        newFailureThreshold=newFailureThreshold.replace("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str",pairs.getValue().toString());
      }
      if (newFailureThreshold.contains("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str")) {
        newFailureThreshold=newFailureThreshold.replace("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str",pairs.getValue().toString());
      }
      if (newFailureThreshold.contains("String_Node_Str" + pairs.getKey().toString())) {
        newFailureThreshold=newFailureThreshold.replace("String_Node_Str" + pairs.getKey().toString(),pairs.getValue().toString());
      }
      if (unstableThreshold.contains("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str")) {
        unstableThreshold=unstableThreshold.replace("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str",pairs.getValue().toString());
      }
      if (unstableThreshold.contains("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str")) {
        unstableThreshold=unstableThreshold.replace("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str",pairs.getValue().toString());
      }
      if (unstableThreshold.contains("String_Node_Str" + pairs.getKey().toString())) {
        unstableThreshold=unstableThreshold.replace("String_Node_Str" + pairs.getKey().toString(),pairs.getValue().toString());
      }
      if (newUnstableThreshold.contains("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str")) {
        newUnstableThreshold=newUnstableThreshold.replace("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str",pairs.getValue().toString());
      }
      if (newUnstableThreshold.contains("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str")) {
        newUnstableThreshold=newUnstableThreshold.replace("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str",pairs.getValue().toString());
      }
      if (newUnstableThreshold.contains("String_Node_Str" + pairs.getKey().toString())) {
        newUnstableThreshold=newUnstableThreshold.replace("String_Node_Str" + pairs.getKey().toString(),pairs.getValue().toString());
      }
      it.remove();
    }
  }
  if (isErrorCountExceeded(errorsCount,failureThreshold)) {
    listener.getLogger().println("String_Node_Str" + KloMetricUtil.getMessageSelectedSeverties(kloConfig) + "String_Node_Str"+ failureThreshold+ "String_Node_Str");
    return Result.FAILURE;
  }
  if (isErrorCountExceeded(newErrorsCount,newFailureThreshold)) {
    listener.getLogger().println("String_Node_Str" + KloMetricUtil.getMessageSelectedSeverties(kloConfig) + "String_Node_Str"+ newFailureThreshold+ "String_Node_Str");
    return Result.FAILURE;
  }
  if (isErrorCountExceeded(errorsCount,unstableThreshold)) {
    listener.getLogger().println("String_Node_Str" + KloMetricUtil.getMessageSelectedSeverties(kloConfig) + "String_Node_Str"+ unstableThreshold+ "String_Node_Str");
    return Result.UNSTABLE;
  }
  if (isErrorCountExceeded(newErrorsCount,newUnstableThreshold)) {
    listener.getLogger().println("String_Node_Str" + KloMetricUtil.getMessageSelectedSeverties(kloConfig) + "String_Node_Str"+ newUnstableThreshold+ "String_Node_Str");
    return Result.UNSTABLE;
  }
  listener.getLogger().println("String_Node_Str");
  return Result.SUCCESS;
}

Fixed version (ground truth):
public Result evaluateBuildResult(final BuildListener listener,int errorsCount,int newErrorsCount,KloConfig kloConfig,Map<String,String> matrixBuildVars){
  String failureThreshold=kloConfig.getConfigSeverityEvaluation().getFailureThreshold();
  String newFailureThreshold=kloConfig.getConfigSeverityEvaluation().getNewFailureThreshold();
  String unstableThreshold=kloConfig.getConfigSeverityEvaluation().getThreshold();
  String newUnstableThreshold=kloConfig.getConfigSeverityEvaluation().getNewThreshold();
  if (matrixBuildVars != null) {
    Iterator it=matrixBuildVars.entrySet().iterator();
    while (it.hasNext()) {
      Map.Entry pairs=(Map.Entry)it.next();
      if (failureThreshold != null && failureThreshold.length() > 0) {
        if (failureThreshold.contains("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str")) {
          failureThreshold=failureThreshold.replace("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str",pairs.getValue().toString());
        }
        if (failureThreshold.contains("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str")) {
          failureThreshold=failureThreshold.replace("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str",pairs.getValue().toString());
        }
        if (failureThreshold.contains("String_Node_Str" + pairs.getKey().toString())) {
          failureThreshold=failureThreshold.replace("String_Node_Str" + pairs.getKey().toString(),pairs.getValue().toString());
        }
      }
      if (newFailureThreshold != null && newFailureThreshold.length() > 0) {
        if (newFailureThreshold.contains("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str")) {
          newFailureThreshold=newFailureThreshold.replace("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str",pairs.getValue().toString());
        }
        if (newFailureThreshold.contains("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str")) {
          newFailureThreshold=newFailureThreshold.replace("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str",pairs.getValue().toString());
        }
        if (newFailureThreshold.contains("String_Node_Str" + pairs.getKey().toString())) {
          newFailureThreshold=newFailureThreshold.replace("String_Node_Str" + pairs.getKey().toString(),pairs.getValue().toString());
        }
      }
      if (unstableThreshold != null && unstableThreshold.length() > 0) {
        if (unstableThreshold.contains("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str")) {
          unstableThreshold=unstableThreshold.replace("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str",pairs.getValue().toString());
        }
        if (unstableThreshold.contains("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str")) {
          unstableThreshold=unstableThreshold.replace("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str",pairs.getValue().toString());
        }
        if (unstableThreshold.contains("String_Node_Str" + pairs.getKey().toString())) {
          unstableThreshold=unstableThreshold.replace("String_Node_Str" + pairs.getKey().toString(),pairs.getValue().toString());
        }
      }
      if (newUnstableThreshold != null && newUnstableThreshold.length() > 0) {
        if (newUnstableThreshold.contains("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str")) {
          newUnstableThreshold=newUnstableThreshold.replace("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str",pairs.getValue().toString());
        }
        if (newUnstableThreshold.contains("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str")) {
          newUnstableThreshold=newUnstableThreshold.replace("String_Node_Str" + pairs.getKey().toString() + "String_Node_Str",pairs.getValue().toString());
        }
        if (newUnstableThreshold.contains("String_Node_Str" + pairs.getKey().toString())) {
          newUnstableThreshold=newUnstableThreshold.replace("String_Node_Str" + pairs.getKey().toString(),pairs.getValue().toString());
        }
      }
      it.remove();
    }
  }
  if (isErrorCountExceeded(errorsCount,failureThreshold)) {
    listener.getLogger().println("String_Node_Str" + KloMetricUtil.getMessageSelectedSeverties(kloConfig) + "String_Node_Str"+ failureThreshold+ "String_Node_Str");
    return Result.FAILURE;
  }
  if (isErrorCountExceeded(newErrorsCount,newFailureThreshold)) {
    listener.getLogger().println("String_Node_Str" + KloMetricUtil.getMessageSelectedSeverties(kloConfig) + "String_Node_Str"+ newFailureThreshold+ "String_Node_Str");
    return Result.FAILURE;
  }
  if (isErrorCountExceeded(errorsCount,unstableThreshold)) {
    listener.getLogger().println("String_Node_Str" + KloMetricUtil.getMessageSelectedSeverties(kloConfig) + "String_Node_Str"+ unstableThreshold+ "String_Node_Str");
    return Result.UNSTABLE;
  }
  if (isErrorCountExceeded(newErrorsCount,newUnstableThreshold)) {
    listener.getLogger().println("String_Node_Str" + KloMetricUtil.getMessageSelectedSeverties(kloConfig) + "String_Node_Str"+ newUnstableThreshold+ "String_Node_Str");
    return Result.UNSTABLE;
  }
  listener.getLogger().println("String_Node_Str");
  return Result.SUCCESS;
}