Program: 17302
Project: 17302
Buggy source:
public static void main(String[] args){
  try {
    Thread.setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler());
    String containerIdStr=System.getenv(Environment.CONTAINER_ID.name());
    String nodeHostString=System.getenv(Environment.NM_HOST.name());
    String nodePortString=System.getenv(Environment.NM_PORT.name());
    String nodeHttpPortString=System.getenv(Environment.NM_HTTP_PORT.name());
    String appSubmitTimeStr=System.getenv(ApplicationConstants.APP_SUBMIT_TIME_ENV);
    validateInputParam(appSubmitTimeStr,ApplicationConstants.APP_SUBMIT_TIME_ENV);
    ContainerId containerId=ConverterUtils.toContainerId(containerIdStr);
    ApplicationAttemptId applicationAttemptId=containerId.getApplicationAttemptId();
    long appSubmitTime=Long.parseLong(appSubmitTimeStr);
    Options opts=getCliOptions();
    CommandLine cliParser=new GnuParser().parse(opts,args);
    String type;
    DAGConfiguration dagPlan=null;
    TezConfiguration conf=new TezConfiguration(new YarnConfiguration());
    if (cliParser.hasOption(OPT_PREDEFINED)) {
      LOG.info("String_Node_Str");
      type=cliParser.getOptionValue(OPT_PREDEFINED,"String_Node_Str");
      LOG.info("String_Node_Str" + type);
      if (type.equals("String_Node_Str")) {
        dagPlan=(DAGConfiguration)MRRExampleHelper.createDAGConfigurationForMR();
      }
 else       if (type.equals("String_Node_Str")) {
        dagPlan=(DAGConfiguration)MRRExampleHelper.createDAGConfigurationForMRR();
      }
    }
 else {
      dagPlan=new DAGConfiguration();
      dagPlan.addResource(TezConfiguration.DAG_AM_PLAN_CONFIG_XML);
    }
    LOG.info("String_Node_Str" + dagPlan.getVertices().length + "String_Node_Str");
    for (    String v : dagPlan.getVertices()) {
      LOG.info("String_Node_Str" + v);
    }
    String jobUserName=System.getenv(ApplicationConstants.Environment.USER.name());
    conf.setBoolean("String_Node_Str",false);
    conf.set(TezConfiguration.USER_NAME,jobUserName);
    Map<String,String> config=dagPlan.getConfig();
    for (    Entry<String,String> entry : config.entrySet()) {
      conf.set(entry.getKey(),entry.getValue());
    }
    DAGAppMaster appMaster=new DAGAppMaster(applicationAttemptId,containerId,nodeHostString,Integer.parseInt(nodePortString),Integer.parseInt(nodeHttpPortString),appSubmitTime,dagPlan);
    ShutdownHookManager.get().addShutdownHook(new DAGAppMasterShutdownHook(appMaster),SHUTDOWN_HOOK_PRIORITY);
    initAndStartAppMaster(appMaster,conf,jobUserName);
  }
 catch (  Throwable t) {
    LOG.fatal("String_Node_Str",t);
    System.exit(1);
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  try {
    Thread.setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler());
    String containerIdStr=System.getenv(Environment.CONTAINER_ID.name());
    String nodeHostString=System.getenv(Environment.NM_HOST.name());
    String nodePortString=System.getenv(Environment.NM_PORT.name());
    String nodeHttpPortString=System.getenv(Environment.NM_HTTP_PORT.name());
    String appSubmitTimeStr=System.getenv(ApplicationConstants.APP_SUBMIT_TIME_ENV);
    validateInputParam(appSubmitTimeStr,ApplicationConstants.APP_SUBMIT_TIME_ENV);
    ContainerId containerId=ConverterUtils.toContainerId(containerIdStr);
    ApplicationAttemptId applicationAttemptId=containerId.getApplicationAttemptId();
    long appSubmitTime=Long.parseLong(appSubmitTimeStr);
    Options opts=getCliOptions();
    CommandLine cliParser=new GnuParser().parse(opts,args);
    String type;
    DAGConfiguration dagPlan=null;
    TezConfiguration conf=new TezConfiguration(new YarnConfiguration());
    if (cliParser.hasOption(OPT_PREDEFINED)) {
      LOG.info("String_Node_Str");
      type=cliParser.getOptionValue(OPT_PREDEFINED,"String_Node_Str");
      LOG.info("String_Node_Str" + type);
      if (type.equals("String_Node_Str")) {
        dagPlan=(DAGConfiguration)MRRExampleHelper.createDAGConfigurationForMR();
      }
 else       if (type.equals("String_Node_Str")) {
        dagPlan=(DAGConfiguration)MRRExampleHelper.createDAGConfigurationForMRR();
      }
    }
 else {
      dagPlan=new DAGConfiguration();
      dagPlan.addResource(TezConfiguration.DAG_AM_PLAN_CONFIG_XML);
    }
    LOG.info("String_Node_Str" + dagPlan.getVertices().length + "String_Node_Str");
    for (    String v : dagPlan.getVertices()) {
      LOG.info("String_Node_Str" + v);
    }
    String jobUserName=System.getenv(ApplicationConstants.Environment.USER.name());
    conf.setBoolean("String_Node_Str",false);
    Map<String,String> config=dagPlan.getConfig();
    for (    Entry<String,String> entry : config.entrySet()) {
      conf.set(entry.getKey(),entry.getValue());
    }
    DAGAppMaster appMaster=new DAGAppMaster(applicationAttemptId,containerId,nodeHostString,Integer.parseInt(nodePortString),Integer.parseInt(nodeHttpPortString),appSubmitTime,dagPlan);
    ShutdownHookManager.get().addShutdownHook(new DAGAppMasterShutdownHook(appMaster),SHUTDOWN_HOOK_PRIORITY);
    initAndStartAppMaster(appMaster,conf,jobUserName);
  }
 catch (  Throwable t) {
    LOG.fatal("String_Node_Str",t);
    System.exit(1);
  }
}