Program: 134366
Project: 134366
Buggy source:
public CheckResult check(String gridName,String rowName,String colName,Map params,Map<String,String> rowVars,Map<String,String> colVars,int timeout){
  if (!params.containsKey(PARAM_COMMAND) || params.get(PARAM_COMMAND) == null) {
    return new CheckResult(CheckConstants.RESULT_UNKNOWN,"String_Node_Str",null);
  }
  String command=(String)params.get(PARAM_COMMAND);
  for (  String rowVar : rowVars.keySet()) {
    command=command.replaceAll("String_Node_Str" + rowVar,rowVars.get(rowVar));
  }
  command=command.replaceAll("String_Node_Str",rowName);
  for (  String colVar : colVars.keySet()) {
    command=command.replaceAll("String_Node_Str" + colVar,rowVars.get(colVar));
  }
  command=command.replaceAll("String_Node_Str",colName);
  NetLogger netLog=NetLogger.getTlogger();
  CheckResult result=null;
  Runtime runtime=Runtime.getRuntime();
  Process process=null;
  try {
    netlogger.debug(netLog.start("String_Node_Str"));
    log.debug("String_Node_Str" + command);
    process=runtime.exec(command);
    WatchDog watchdog=new WatchDog(process);
    watchdog.start();
    watchdog.join(timeout * 1000);
    if (watchdog.exit == null) {
      result=new CheckResult(CheckConstants.RESULT_UNKNOWN,"String_Node_Str" + timeout + "String_Node_Str",null);
    }
 else {
      int resultCode=process.exitValue();
      String outputLine=null;
      Map returnParams=null;
      if (resultCode < CheckConstants.RESULT_SUCCESS) {
        outputLine="String_Node_Str" + resultCode + "String_Node_Str";
        resultCode=CheckConstants.RESULT_UNKNOWN;
      }
 else {
        BufferedReader stdin=new BufferedReader(new InputStreamReader(process.getInputStream()));
        outputLine=stdin.readLine();
        returnParams=this.parseReturnParams(outputLine);
        outputLine=this.formatOutputLine(outputLine);
      }
      result=new CheckResult(resultCode,outputLine,returnParams);
    }
    netlogger.debug(netLog.end("String_Node_Str"));
  }
 catch (  Exception e) {
    netlogger.debug(netLog.error("String_Node_Str",e.getMessage()));
    log.error("String_Node_Str" + e.getMessage());
    result=new CheckResult(CheckConstants.RESULT_UNKNOWN,"String_Node_Str" + e.getMessage(),null);
    e.printStackTrace();
  }
 finally {
    if (process != null) {
      process.destroy();
    }
  }
  return result;
}

Fixed version (ground truth):
public CheckResult check(String gridName,String rowName,String colName,Map params,TemplateVariableMap rowVars,TemplateVariableMap colVars,int timeout){
  if (!params.containsKey(PARAM_COMMAND) || params.get(PARAM_COMMAND) == null) {
    return new CheckResult(CheckConstants.RESULT_UNKNOWN,"String_Node_Str",null);
  }
  String command=(String)params.get(PARAM_COMMAND);
  for (  String rowVar : rowVars.keySet()) {
    command=command.replaceAll("String_Node_Str" + rowVar,rowVars.get(rowVar));
  }
  command=command.replaceAll("String_Node_Str",rowName);
  for (  String colVar : colVars.keySet()) {
    command=command.replaceAll("String_Node_Str" + colVar,rowVars.get(colVar));
  }
  command=command.replaceAll("String_Node_Str",colName);
  NetLogger netLog=NetLogger.getTlogger();
  CheckResult result=null;
  Runtime runtime=Runtime.getRuntime();
  Process process=null;
  try {
    netlogger.debug(netLog.start("String_Node_Str"));
    log.debug("String_Node_Str" + command);
    process=runtime.exec(command);
    WatchDog watchdog=new WatchDog(process);
    watchdog.start();
    watchdog.join(timeout * 1000);
    if (watchdog.exit == null) {
      result=new CheckResult(CheckConstants.RESULT_UNKNOWN,"String_Node_Str" + timeout + "String_Node_Str",null);
    }
 else {
      int resultCode=process.exitValue();
      String outputLine=null;
      Map returnParams=null;
      if (resultCode < CheckConstants.RESULT_SUCCESS) {
        outputLine="String_Node_Str" + resultCode + "String_Node_Str";
        resultCode=CheckConstants.RESULT_UNKNOWN;
      }
 else {
        BufferedReader stdin=new BufferedReader(new InputStreamReader(process.getInputStream()));
        outputLine=stdin.readLine();
        returnParams=this.parseReturnParams(outputLine);
        outputLine=this.formatOutputLine(outputLine);
      }
      result=new CheckResult(resultCode,outputLine,returnParams);
    }
    netlogger.debug(netLog.end("String_Node_Str"));
  }
 catch (  Exception e) {
    netlogger.debug(netLog.error("String_Node_Str",e.getMessage()));
    log.error("String_Node_Str" + e.getMessage());
    result=new CheckResult(CheckConstants.RESULT_UNKNOWN,"String_Node_Str" + e.getMessage(),null);
    e.printStackTrace();
  }
 finally {
    if (process != null) {
      process.destroy();
    }
  }
  return result;
}