Program: 31832
Project: 31832
Buggy source:
/** 
 * Main entry for the whole framework.
 * @throws IOException
 */
public static void main(String[] args){
  if (args.length < 1 || (isHelpOption(args[0]))) {
    printUsage();
    System.exit(args.length < 1 ? -1 : 0);
  }
  if (isVersionOption(args[0])) {
    printLogoAndVersion();
    System.exit(0);
  }
  CommandLineParser parser=new GnuParser();
  Options opts=buildModelSetOptions(args);
  CommandLine cmd=null;
  try {
    cmd=parser.parse(opts,args);
  }
 catch (  ParseException e) {
    log.error("String_Node_Str");
    printUsage();
    System.exit(1);
  }
  int status=0;
  try {
    if (args[0].equals(NEW) && args.length >= 2 && StringUtils.isNotEmpty(args[1])) {
      String modelName=args[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 (args[0].equals(MODELSET_CMD_CP) && args.length >= 3 && StringUtils.isNotEmpty(args[1]) && StringUtils.isNotEmpty(args[2])) {
        String newModelSetName=args[2];
        copyModel(new String[]{args[1],newModelSetName});
        printModelSetCopiedSuccessfulLog(newModelSetName);
      }
 else       if (args[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 (args[0].equals(STATS_CMD)) {
        status=calModelStats();
        if (status == 0) {
          log.info("String_Node_Str");
        }
 else {
          log.warn("String_Node_Str");
        }
      }
 else       if (args[0].equals(NORMALIZE_CMD) || args[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 (args[0].equals(VARSELECT_CMD) || args[0].equals(VARSEL_CMD)) {
        status=selectModelVar(cmd.hasOption(RESET));
        if (status == 0) {
          log.info("String_Node_Str");
        }
 else {
          log.info("String_Node_Str");
        }
      }
 else       if (args[0].equals(TRAIN_CMD)) {
        status=trainModel(cmd.hasOption(TRAIN_CMD_DRY),cmd.hasOption(TRAIN_CMD_DEBUG));
        if (status == 0) {
          log.info("String_Node_Str");
        }
 else {
          log.info("String_Node_Str");
        }
      }
 else       if (args[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 (args[0].equals(POSTTRAIN_CMD)) {
        status=postTrainModel();
        if (status == 0) {
          log.info("String_Node_Str");
        }
 else {
          log.info("String_Node_Str");
        }
      }
 else       if (args[0].equals(SAVE)) {
        String newModelSetName=args.length >= 2 ? args[1] : null;
        saveCurrentModel(newModelSetName);
      }
 else       if (args[0].equals(SWITCH)) {
        String newModelSetName=args[1];
        switchCurrentModel(newModelSetName);
      }
 else       if (args[0].equals(SHOW)) {
        ManageModelProcessor p=new ManageModelProcessor(ModelAction.SHOW,null);
        p.run();
      }
 else       if (args[0].equals(EVAL_CMD)) {
        if (args.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 (args[0].equals(CMD_EXPORT)) {
        boolean isConcise=cmd.hasOption(EXPORT_CONCISE);
        status=exportModel(cmd.getOptionValue(MODELSET_CMD_TYPE),isConcise);
        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){
  if (args.length < 1 || (isHelpOption(args[0]))) {
    printUsage();
    System.exit(args.length < 1 ? -1 : 0);
  }
  if (isVersionOption(args[0])) {
    printLogoAndVersion();
    System.exit(0);
  }
  CommandLineParser parser=new GnuParser();
  Options opts=buildModelSetOptions(args);
  CommandLine cmd=null;
  try {
    cmd=parser.parse(opts,args);
  }
 catch (  ParseException e) {
    log.error("String_Node_Str");
    printUsage();
    System.exit(1);
  }
  int status=0;
  try {
    if (args[0].equals(NEW) && args.length >= 2 && StringUtils.isNotEmpty(args[1])) {
      String modelName=args[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 (args[0].equals(MODELSET_CMD_CP) && args.length >= 3 && StringUtils.isNotEmpty(args[1]) && StringUtils.isNotEmpty(args[2])) {
        String newModelSetName=args[2];
        copyModel(new String[]{args[1],newModelSetName});
        printModelSetCopiedSuccessfulLog(newModelSetName);
      }
 else       if (args[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 (args[0].equals(STATS_CMD)) {
        status=calModelStats();
        if (status == 0) {
          log.info("String_Node_Str");
        }
 else {
          log.warn("String_Node_Str");
        }
      }
 else       if (args[0].equals(NORMALIZE_CMD) || args[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 (args[0].equals(VARSELECT_CMD) || args[0].equals(VARSEL_CMD)) {
        status=selectModelVar(cmd.hasOption(RESET));
        if (status == 0) {
          log.info("String_Node_Str");
        }
 else {
          log.info("String_Node_Str");
        }
      }
 else       if (args[0].equals(TRAIN_CMD)) {
        status=trainModel(cmd.hasOption(TRAIN_CMD_DRY),cmd.hasOption(TRAIN_CMD_DEBUG));
        if (status == 0) {
          log.info("String_Node_Str");
        }
 else {
          log.info("String_Node_Str");
        }
      }
 else       if (args[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 (args[0].equals(POSTTRAIN_CMD)) {
        status=postTrainModel();
        if (status == 0) {
          log.info("String_Node_Str");
        }
 else {
          log.info("String_Node_Str");
        }
      }
 else       if (args[0].equals(SAVE)) {
        String newModelSetName=args.length >= 2 ? args[1] : null;
        saveCurrentModel(newModelSetName);
      }
 else       if (args[0].equals(SWITCH)) {
        String newModelSetName=args[1];
        switchCurrentModel(newModelSetName);
      }
 else       if (args[0].equals(SHOW)) {
        ManageModelProcessor p=new ManageModelProcessor(ModelAction.SHOW,null);
        p.run();
      }
 else       if (args[0].equals(EVAL_CMD)) {
        if (args.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 (args[0].equals(CMD_EXPORT)) {
        boolean isConcise=cmd.hasOption(EXPORT_CONCISE);
        status=exportModel(cmd.getOptionValue(MODELSET_CMD_TYPE),isConcise);
        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);
  }
}