Program: 31731
Project: 31731
Buggy source:
public static void main(String[] args){
  List<String> cleanedArgsList=new ArrayList<String>();
  for (int i=0; i < args.length; i++) {
    if (args[i].startsWith("String_Node_Str")) {
      String keyValue=args[i].substring(2,args[i].length());
      int index=keyValue.indexOf("String_Node_Str");
      String key=keyValue.substring(0,index);
      String value="String_Node_Str";
      if (keyValue.length() >= index + 1) {
        value=keyValue.substring(index + 1,keyValue.length());
      }
      Environment.setProperty(key.trim(),value.trim());
      System.setProperty(key.trim(),value.trim());
      cleanedArgsList.add(args[i]);
    }
  }
  String[] cleanedArgs=cleanedArgsList.toArray(new String[0]);
  if (cleanedArgs.length < 1 || (isHelpOption(cleanedArgs[0]))) {
    printUsage();
    System.exit(cleanedArgs.length < 1 ? -1 : 0);
  }
  if (isVersionOption(cleanedArgs[0])) {
    printLogoAndVersion();
    System.exit(0);
  }
  CommandLineParser parser=new GnuParser();
  Options opts=buildModelSetOptions(cleanedArgs);
  CommandLine cmd=null;
  try {
    cmd=parser.parse(opts,cleanedArgs);
  }
 catch (  ParseException e) {
    log.error("String_Node_Str");
    printUsage();
    System.exit(1);
  }
  int status=0;
  try {
    if (cleanedArgs[0].equals(NEW) && cleanedArgs.length >= 2 && StringUtils.isNotEmpty(cleanedArgs[1])) {
      String modelName=cleanedArgs[1];
      status=createNewModel(modelName,cmd.getOptionValue(MODELSET_CMD_TYPE),cmd.getOptionValue(MODELSET_CMD_M));
      if (status == 0) {
        printModelSetCreatedSuccessfulLog(modelName);
      }
 else {
        log.warn("String_Node_Str");
      }
      System.exit(status);
    }
 else {
      if (cleanedArgs[0].equals(MODELSET_CMD_CP) && cleanedArgs.length >= 3 && StringUtils.isNotEmpty(cleanedArgs[1]) && StringUtils.isNotEmpty(cleanedArgs[2])) {
        String newModelSetName=cleanedArgs[2];
        copyModel(new String[]{cleanedArgs[1],newModelSetName});
        printModelSetCopiedSuccessfulLog(newModelSetName);
      }
 else       if (cleanedArgs[0].equals(INIT_CMD)) {
        if (cmd.getOptions() == null || cmd.getOptions().length == 0) {
          status=initializeModel();
          if (status == 0) {
            log.info("String_Node_Str");
          }
 else {
            log.warn("String_Node_Str");
          }
        }
 else         if (cmd.hasOption(INIT_CMD_MODEL)) {
          initializeModelParam();
        }
 else {
          log.error("String_Node_Str");
          printUsage();
        }
      }
 else       if (cleanedArgs[0].equals(STATS_CMD)) {
        Map<String,Object> params=new HashMap<String,Object>();
        params.put(StatsModelProcessor.IS_COMPUTE_CORR,cmd.hasOption(CORRELATION) || cmd.hasOption("String_Node_Str"));
        params.put(StatsModelProcessor.IS_REBIN,cmd.hasOption(REBIN));
        params.put(StatsModelProcessor.REQUEST_VARS,cmd.getOptionValue(VARS));
        params.put(StatsModelProcessor.EXPECTED_BIN_NUM,cmd.getOptionValue(N));
        params.put(StatsModelProcessor.IV_KEEP_RATIO,cmd.getOptionValue(IVR));
        params.put(StatsModelProcessor.MINIMUM_BIN_INST_CNT,cmd.getOptionValue(BIC));
        status=calModelStats(params);
        if (status == 0) {
          if (cmd.hasOption(CORRELATION) || cmd.hasOption("String_Node_Str")) {
            log.info("String_Node_Str");
          }
 else {
            log.info("String_Node_Str");
          }
        }
 else {
          log.warn("String_Node_Str");
        }
      }
 else       if (cleanedArgs[0].equals(NORMALIZE_CMD) || cleanedArgs[0].equals(NORM_CMD)) {
        status=normalizeTrainData(cmd.hasOption(SHUFFLE));
        if (status == 0) {
          log.info("String_Node_Str");
        }
 else {
          log.warn("String_Node_Str");
        }
      }
 else       if (cleanedArgs[0].equals(VARSELECT_CMD) || cleanedArgs[0].equals(VARSEL_CMD)) {
        status=selectModelVar(cmd.hasOption(RESET),cmd.hasOption(LIST));
        if (status == 0) {
          log.info("String_Node_Str");
        }
 else {
          log.info("String_Node_Str");
        }
      }
 else       if (cleanedArgs[0].equals(TRAIN_CMD)) {
        status=trainModel(cmd.hasOption(TRAIN_CMD_DRY),cmd.hasOption(TRAIN_CMD_DEBUG),cmd.hasOption(SHUFFLE));
        if (status == 0) {
          log.info("String_Node_Str");
        }
 else {
          log.info("String_Node_Str");
        }
      }
 else       if (cleanedArgs[0].equals(CMD_COMBO)) {
        if (cmd.hasOption(MODELSET_CMD_NEW)) {
          log.info("String_Node_Str");
          status=createNewCombo(cmd.getOptionValue(MODELSET_CMD_NEW));
        }
 else         if (cmd.hasOption(INIT_CMD)) {
          log.info("String_Node_Str");
          status=initComboModels();
        }
 else         if (cmd.hasOption(EVAL_CMD_RUN)) {
          log.info("String_Node_Str",opts.hasOption(SHUFFLE),opts.hasOption(RESUME));
          status=runComboModels(cmd.hasOption(SHUFFLE),cmd.hasOption(RESUME));
        }
 else         if (cmd.hasOption(EVAL_CMD)) {
          log.info("String_Node_Str");
          status=evalComboModels(cmd.hasOption(RESUME));
        }
 else {
          log.error("String_Node_Str");
          printUsage();
        }
      }
 else       if (cleanedArgs[0].equals(POSTTRAIN_CMD)) {
        status=postTrainModel();
        if (status == 0) {
          log.info("String_Node_Str");
        }
 else {
          log.info("String_Node_Str");
        }
      }
 else       if (cleanedArgs[0].equals(SAVE)) {
        String newModelSetName=cleanedArgs.length >= 2 ? cleanedArgs[1] : null;
        saveCurrentModel(newModelSetName);
      }
 else       if (cleanedArgs[0].equals(SWITCH)) {
        String newModelSetName=cleanedArgs[1];
        switchCurrentModel(newModelSetName);
      }
 else       if (cleanedArgs[0].equals(SHOW)) {
        ManageModelProcessor p=new ManageModelProcessor(ModelAction.SHOW,null);
        p.run();
      }
 else       if (cleanedArgs[0].equals(EVAL_CMD)) {
        if (cleanedArgs.length == 1) {
          status=runEvalSet(cmd.hasOption(TRAIN_CMD_DRY));
          if (status == 0) {
            log.info("String_Node_Str");
          }
 else {
            log.info("String_Node_Str");
          }
        }
 else         if (cmd.getOptionValue(MODELSET_CMD_NEW) != null) {
          createNewEvalSet(cmd.getOptionValue(MODELSET_CMD_NEW));
          log.info("String_Node_Str");
        }
 else         if (cmd.hasOption(EVAL_CMD_RUN)) {
          runEvalSet(cmd.getOptionValue(EVAL_CMD_RUN),cmd.hasOption(TRAIN_CMD_DRY));
          log.info("String_Node_Str",cmd.getOptionValue(EVAL_CMD_RUN));
        }
 else         if (cmd.hasOption(SCORE)) {
          runEvalScore(cmd.getOptionValue(SCORE));
          log.info("String_Node_Str",cmd.getOptionValue(SCORE));
        }
 else         if (cmd.hasOption(CONFMAT)) {
          runEvalConfMat(cmd.getOptionValue(CONFMAT));
          log.info("String_Node_Str",cmd.getOptionValue(CONFMAT));
        }
 else         if (cmd.hasOption(PERF)) {
          runEvalPerf(cmd.getOptionValue(PERF));
          log.info("String_Node_Str",cmd.getOptionValue(PERF));
        }
 else         if (cmd.hasOption(LIST)) {
          listEvalSet();
        }
 else         if (cmd.hasOption(DELETE)) {
          deleteEvalSet(cmd.getOptionValue(DELETE));
        }
 else         if (cmd.hasOption(NORM)) {
          runEvalNorm(cmd.getOptionValue(NORM));
        }
 else {
          log.error("String_Node_Str");
          printUsage();
        }
      }
 else       if (cleanedArgs[0].equals(CMD_EXPORT)) {
        Map<String,Object> params=new HashMap<String,Object>();
        params.put(ExportModelProcessor.IS_CONCISE,cmd.hasOption(EXPORT_CONCISE));
        params.put(ExportModelProcessor.REQUEST_VARS,cmd.getOptionValue(VARS));
        params.put(ExportModelProcessor.EXPECTED_BIN_NUM,cmd.getOptionValue(N));
        params.put(ExportModelProcessor.IV_KEEP_RATIO,cmd.getOptionValue(IVR));
        params.put(ExportModelProcessor.MINIMUM_BIN_INST_CNT,cmd.getOptionValue(BIC));
        status=exportModel(cmd.getOptionValue(MODELSET_CMD_TYPE),params);
        if (status == 0) {
          log.info("String_Node_Str");
        }
 else {
          log.warn("String_Node_Str");
        }
      }
 else {
        log.error("String_Node_Str");
        printUsage();
      }
    }
    System.exit(status);
  }
 catch (  ShifuException e) {
    log.error(e.getError().toString(),e.getCause());
    exceptionExit(e);
  }
catch (  Exception e) {
    exceptionExit(e);
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  List<String> cleanedArgsList=new ArrayList<String>();
  for (int i=0; i < args.length; i++) {
    if (args[i].startsWith("String_Node_Str")) {
      String keyValue=args[i].substring(2,args[i].length());
      int index=keyValue.indexOf("String_Node_Str");
      String key=keyValue.substring(0,index);
      String value="String_Node_Str";
      if (keyValue.length() >= index + 1) {
        value=keyValue.substring(index + 1,keyValue.length());
      }
      Environment.setProperty(key.trim(),value.trim());
      System.setProperty(key.trim(),value.trim());
    }
 else {
      cleanedArgsList.add(args[i]);
    }
  }
  String[] cleanedArgs=cleanedArgsList.toArray(new String[0]);
  if (cleanedArgs.length < 1 || (isHelpOption(cleanedArgs[0]))) {
    printUsage();
    System.exit(cleanedArgs.length < 1 ? -1 : 0);
  }
  if (isVersionOption(cleanedArgs[0])) {
    printLogoAndVersion();
    System.exit(0);
  }
  CommandLineParser parser=new GnuParser();
  Options opts=buildModelSetOptions(cleanedArgs);
  CommandLine cmd=null;
  try {
    cmd=parser.parse(opts,cleanedArgs);
  }
 catch (  ParseException e) {
    log.error("String_Node_Str");
    printUsage();
    System.exit(1);
  }
  int status=0;
  try {
    if (cleanedArgs[0].equals(NEW) && cleanedArgs.length >= 2 && StringUtils.isNotEmpty(cleanedArgs[1])) {
      String modelName=cleanedArgs[1];
      status=createNewModel(modelName,cmd.getOptionValue(MODELSET_CMD_TYPE),cmd.getOptionValue(MODELSET_CMD_M));
      if (status == 0) {
        printModelSetCreatedSuccessfulLog(modelName);
      }
 else {
        log.warn("String_Node_Str");
      }
      System.exit(status);
    }
 else {
      if (cleanedArgs[0].equals(MODELSET_CMD_CP) && cleanedArgs.length >= 3 && StringUtils.isNotEmpty(cleanedArgs[1]) && StringUtils.isNotEmpty(cleanedArgs[2])) {
        String newModelSetName=cleanedArgs[2];
        copyModel(new String[]{cleanedArgs[1],newModelSetName});
        printModelSetCopiedSuccessfulLog(newModelSetName);
      }
 else       if (cleanedArgs[0].equals(INIT_CMD)) {
        if (cmd.getOptions() == null || cmd.getOptions().length == 0) {
          status=initializeModel();
          if (status == 0) {
            log.info("String_Node_Str");
          }
 else {
            log.warn("String_Node_Str");
          }
        }
 else         if (cmd.hasOption(INIT_CMD_MODEL)) {
          initializeModelParam();
        }
 else {
          log.error("String_Node_Str");
          printUsage();
        }
      }
 else       if (cleanedArgs[0].equals(STATS_CMD)) {
        Map<String,Object> params=new HashMap<String,Object>();
        params.put(StatsModelProcessor.IS_COMPUTE_CORR,cmd.hasOption(CORRELATION) || cmd.hasOption("String_Node_Str"));
        params.put(StatsModelProcessor.IS_REBIN,cmd.hasOption(REBIN));
        params.put(StatsModelProcessor.REQUEST_VARS,cmd.getOptionValue(VARS));
        params.put(StatsModelProcessor.EXPECTED_BIN_NUM,cmd.getOptionValue(N));
        params.put(StatsModelProcessor.IV_KEEP_RATIO,cmd.getOptionValue(IVR));
        params.put(StatsModelProcessor.MINIMUM_BIN_INST_CNT,cmd.getOptionValue(BIC));
        status=calModelStats(params);
        if (status == 0) {
          if (cmd.hasOption(CORRELATION) || cmd.hasOption("String_Node_Str")) {
            log.info("String_Node_Str");
          }
 else {
            log.info("String_Node_Str");
          }
        }
 else {
          log.warn("String_Node_Str");
        }
      }
 else       if (cleanedArgs[0].equals(NORMALIZE_CMD) || cleanedArgs[0].equals(NORM_CMD)) {
        status=normalizeTrainData(cmd.hasOption(SHUFFLE));
        if (status == 0) {
          log.info("String_Node_Str");
        }
 else {
          log.warn("String_Node_Str");
        }
      }
 else       if (cleanedArgs[0].equals(VARSELECT_CMD) || cleanedArgs[0].equals(VARSEL_CMD)) {
        status=selectModelVar(cmd.hasOption(RESET),cmd.hasOption(LIST));
        if (status == 0) {
          log.info("String_Node_Str");
        }
 else {
          log.info("String_Node_Str");
        }
      }
 else       if (cleanedArgs[0].equals(TRAIN_CMD)) {
        status=trainModel(cmd.hasOption(TRAIN_CMD_DRY),cmd.hasOption(TRAIN_CMD_DEBUG),cmd.hasOption(SHUFFLE));
        if (status == 0) {
          log.info("String_Node_Str");
        }
 else {
          log.info("String_Node_Str");
        }
      }
 else       if (cleanedArgs[0].equals(CMD_COMBO)) {
        if (cmd.hasOption(MODELSET_CMD_NEW)) {
          log.info("String_Node_Str");
          status=createNewCombo(cmd.getOptionValue(MODELSET_CMD_NEW));
        }
 else         if (cmd.hasOption(INIT_CMD)) {
          log.info("String_Node_Str");
          status=initComboModels();
        }
 else         if (cmd.hasOption(EVAL_CMD_RUN)) {
          log.info("String_Node_Str",opts.hasOption(SHUFFLE),opts.hasOption(RESUME));
          status=runComboModels(cmd.hasOption(SHUFFLE),cmd.hasOption(RESUME));
        }
 else         if (cmd.hasOption(EVAL_CMD)) {
          log.info("String_Node_Str");
          status=evalComboModels(cmd.hasOption(RESUME));
        }
 else {
          log.error("String_Node_Str");
          printUsage();
        }
      }
 else       if (cleanedArgs[0].equals(POSTTRAIN_CMD)) {
        status=postTrainModel();
        if (status == 0) {
          log.info("String_Node_Str");
        }
 else {
          log.info("String_Node_Str");
        }
      }
 else       if (cleanedArgs[0].equals(SAVE)) {
        String newModelSetName=cleanedArgs.length >= 2 ? cleanedArgs[1] : null;
        saveCurrentModel(newModelSetName);
      }
 else       if (cleanedArgs[0].equals(SWITCH)) {
        String newModelSetName=cleanedArgs[1];
        switchCurrentModel(newModelSetName);
      }
 else       if (cleanedArgs[0].equals(SHOW)) {
        ManageModelProcessor p=new ManageModelProcessor(ModelAction.SHOW,null);
        p.run();
      }
 else       if (cleanedArgs[0].equals(EVAL_CMD)) {
        if (cleanedArgs.length == 1) {
          status=runEvalSet(cmd.hasOption(TRAIN_CMD_DRY));
          if (status == 0) {
            log.info("String_Node_Str");
          }
 else {
            log.info("String_Node_Str");
          }
        }
 else         if (cmd.getOptionValue(MODELSET_CMD_NEW) != null) {
          createNewEvalSet(cmd.getOptionValue(MODELSET_CMD_NEW));
          log.info("String_Node_Str");
        }
 else         if (cmd.hasOption(EVAL_CMD_RUN)) {
          runEvalSet(cmd.getOptionValue(EVAL_CMD_RUN),cmd.hasOption(TRAIN_CMD_DRY));
          log.info("String_Node_Str",cmd.getOptionValue(EVAL_CMD_RUN));
        }
 else         if (cmd.hasOption(SCORE)) {
          runEvalScore(cmd.getOptionValue(SCORE));
          log.info("String_Node_Str",cmd.getOptionValue(SCORE));
        }
 else         if (cmd.hasOption(CONFMAT)) {
          runEvalConfMat(cmd.getOptionValue(CONFMAT));
          log.info("String_Node_Str",cmd.getOptionValue(CONFMAT));
        }
 else         if (cmd.hasOption(PERF)) {
          runEvalPerf(cmd.getOptionValue(PERF));
          log.info("String_Node_Str",cmd.getOptionValue(PERF));
        }
 else         if (cmd.hasOption(LIST)) {
          listEvalSet();
        }
 else         if (cmd.hasOption(DELETE)) {
          deleteEvalSet(cmd.getOptionValue(DELETE));
        }
 else         if (cmd.hasOption(NORM)) {
          runEvalNorm(cmd.getOptionValue(NORM));
        }
 else {
          log.error("String_Node_Str");
          printUsage();
        }
      }
 else       if (cleanedArgs[0].equals(CMD_EXPORT)) {
        Map<String,Object> params=new HashMap<String,Object>();
        params.put(ExportModelProcessor.IS_CONCISE,cmd.hasOption(EXPORT_CONCISE));
        params.put(ExportModelProcessor.REQUEST_VARS,cmd.getOptionValue(VARS));
        params.put(ExportModelProcessor.EXPECTED_BIN_NUM,cmd.getOptionValue(N));
        params.put(ExportModelProcessor.IV_KEEP_RATIO,cmd.getOptionValue(IVR));
        params.put(ExportModelProcessor.MINIMUM_BIN_INST_CNT,cmd.getOptionValue(BIC));
        status=exportModel(cmd.getOptionValue(MODELSET_CMD_TYPE),params);
        if (status == 0) {
          log.info("String_Node_Str");
        }
 else {
          log.warn("String_Node_Str");
        }
      }
 else {
        log.error("String_Node_Str");
        printUsage();
      }
    }
    System.exit(status);
  }
 catch (  ShifuException e) {
    log.error(e.getError().toString(),e.getCause());
    exceptionExit(e);
  }
catch (  Exception e) {
    exceptionExit(e);
  }
}