Program: 34449
Project: 34449
Buggy source:
private ContainerLaunchContext setupContainerLaunchContextForDefaultAM(FrameworkStatus frameworkStatus,FrameworkRequest frameworkRequest,Resource amResource) throws Exception {
  String frameworkName=frameworkStatus.getFrameworkName();
  Integer frameworkVersion=frameworkStatus.getFrameworkVersion();
  UserDescriptor loggedInUser=statusManager.getLoggedInUser();
  Map<String,LocalResource> localResources=new HashMap<>();
  hdfsStore.makeFrameworkRootDir(frameworkName);
  HadoopUtils.addToLocalResources(localResources,hdfsStore.uploadAMPackageFile(frameworkName));
  Map<String,String> localEnvs=new HashMap<>();
  StringBuilder classpath=new StringBuilder(ApplicationConstants.Environment.CLASSPATH.$$()).append(ApplicationConstants.CLASS_PATH_SEPARATOR).append("String_Node_Str");
  for (  String c : yarnConf.getStrings(YarnConfiguration.YARN_APPLICATION_CLASSPATH,YarnConfiguration.DEFAULT_YARN_CROSS_PLATFORM_APPLICATION_CLASSPATH)) {
    classpath.append(ApplicationConstants.CLASS_PATH_SEPARATOR);
    classpath.append(c.trim());
  }
  classpath.append(ApplicationConstants.CLASS_PATH_SEPARATOR).append(GlobalConstants.LOGGER_CONFIG_FILE);
  if (yarnConf.getBoolean(YarnConfiguration.IS_MINI_YARN_CLUSTER,false)) {
    classpath.append(':');
    classpath.append(System.getProperty("String_Node_Str"));
  }
  localEnvs.put(GlobalConstants.ENV_VAR_CLASSPATH,classpath.toString());
  localEnvs.put(GlobalConstants.ENV_VAR_HADOOP_USER_NAME,loggedInUser.getName());
  localEnvs.put(GlobalConstants.ENV_VAR_FRAMEWORK_NAME,frameworkName);
  localEnvs.put(GlobalConstants.ENV_VAR_FRAMEWORK_VERSION,frameworkVersion.toString());
  localEnvs.put(GlobalConstants.ENV_VAR_ZK_CONNECT_STRING,conf.getZkConnectString());
  localEnvs.put(GlobalConstants.ENV_VAR_ZK_ROOT_DIR,conf.getZkRootDir());
  localEnvs.put(GlobalConstants.ENV_VAR_AM_VERSION,conf.getAmVersion().toString());
  localEnvs.put(GlobalConstants.ENV_VAR_AM_RM_HEARTBEAT_INTERVAL_SEC,conf.getAmRmHeartbeatIntervalSec().toString());
  Vector<CharSequence> vargs=new Vector<>(30);
  vargs.add(ApplicationConstants.Environment.JAVA_HOME.$$() + "String_Node_Str");
  vargs.add("String_Node_Str");
  vargs.add("String_Node_Str" + amResource.getMemory() + "String_Node_Str");
  vargs.add(GlobalConstants.MAIN_CLASS_APPLICATION_MASTER);
  vargs.add(String.format("String_Node_Str",ApplicationConstants.LOG_DIR_EXPANSION_VAR + File.separator));
  StringBuilder command=new StringBuilder();
  for (  CharSequence str : vargs) {
    command.append(str).append("String_Node_Str");
  }
  List<String> commands=new ArrayList<>();
  commands.add(command.toString());
  ByteBuffer fsTokens=null;
  if (UserGroupInformation.isSecurityEnabled()) {
    Credentials credentials=new Credentials();
    String tokenRenewer=yarnConf.get(YarnConfiguration.RM_PRINCIPAL);
    FileSystem fs=FileSystem.get(yarnConf);
    if (tokenRenewer == null || tokenRenewer.length() == 0) {
      throw new IOException("String_Node_Str");
    }
    final org.apache.hadoop.security.token.Token<?> tokens[]=fs.addDelegationTokens(tokenRenewer,credentials);
    if (tokens != null) {
      for (      org.apache.hadoop.security.token.Token<?> token : tokens) {
        LOGGER.logInfo("String_Node_Str" + fs.getUri() + "String_Node_Str"+ token);
      }
    }
    DataOutputBuffer dob=new DataOutputBuffer();
    credentials.writeTokenStorageToStream(dob);
    fsTokens=ByteBuffer.wrap(dob.getData(),0,dob.getLength());
  }
  return ContainerLaunchContext.newInstance(localResources,localEnvs,commands,null,fsTokens,null);
}

Fixed version (ground truth):
private ContainerLaunchContext setupContainerLaunchContextForDefaultAM(FrameworkStatus frameworkStatus,FrameworkRequest frameworkRequest,Resource amResource) throws Exception {
  String frameworkName=frameworkStatus.getFrameworkName();
  Integer frameworkVersion=frameworkStatus.getFrameworkVersion();
  UserDescriptor loggedInUser=statusManager.getLoggedInUser();
  Map<String,LocalResource> localResources=new HashMap<>();
  hdfsStore.makeFrameworkRootDir(frameworkName);
  HadoopUtils.addToLocalResources(localResources,hdfsStore.uploadAMPackageFile(frameworkName));
  Map<String,String> localEnvs=new HashMap<>();
  localEnvs.put(ApplicationConstants.Environment.CLASSPATH_PREPEND_DISTCACHE.name(),"String_Node_Str");
  StringBuilder classpath=new StringBuilder("String_Node_Str");
  for (  String c : yarnConf.getStrings(YarnConfiguration.YARN_APPLICATION_CLASSPATH,YarnConfiguration.DEFAULT_YARN_CROSS_PLATFORM_APPLICATION_CLASSPATH)) {
    classpath.append(ApplicationConstants.CLASS_PATH_SEPARATOR).append(c.trim());
  }
  classpath.append(ApplicationConstants.CLASS_PATH_SEPARATOR).append(ApplicationConstants.Environment.CLASSPATH.$$());
  localEnvs.put(GlobalConstants.ENV_VAR_CLASSPATH,classpath.toString());
  localEnvs.put(GlobalConstants.ENV_VAR_HADOOP_USER_NAME,loggedInUser.getName());
  localEnvs.put(GlobalConstants.ENV_VAR_FRAMEWORK_NAME,frameworkName);
  localEnvs.put(GlobalConstants.ENV_VAR_FRAMEWORK_VERSION,frameworkVersion.toString());
  localEnvs.put(GlobalConstants.ENV_VAR_ZK_CONNECT_STRING,conf.getZkConnectString());
  localEnvs.put(GlobalConstants.ENV_VAR_ZK_ROOT_DIR,conf.getZkRootDir());
  localEnvs.put(GlobalConstants.ENV_VAR_AM_VERSION,conf.getAmVersion().toString());
  localEnvs.put(GlobalConstants.ENV_VAR_AM_RM_HEARTBEAT_INTERVAL_SEC,conf.getAmRmHeartbeatIntervalSec().toString());
  Vector<CharSequence> vargs=new Vector<>(30);
  vargs.add(ApplicationConstants.Environment.JAVA_HOME.$$() + "String_Node_Str");
  vargs.add("String_Node_Str");
  vargs.add("String_Node_Str" + amResource.getMemory() + "String_Node_Str");
  vargs.add(GlobalConstants.MAIN_CLASS_APPLICATION_MASTER);
  vargs.add(String.format("String_Node_Str",ApplicationConstants.LOG_DIR_EXPANSION_VAR + File.separator));
  StringBuilder command=new StringBuilder();
  for (  CharSequence str : vargs) {
    command.append(str).append("String_Node_Str");
  }
  List<String> commands=new ArrayList<>();
  commands.add(command.toString());
  ByteBuffer fsTokens=null;
  if (UserGroupInformation.isSecurityEnabled()) {
    Credentials credentials=new Credentials();
    String tokenRenewer=yarnConf.get(YarnConfiguration.RM_PRINCIPAL);
    FileSystem fs=FileSystem.get(yarnConf);
    if (tokenRenewer == null || tokenRenewer.length() == 0) {
      throw new IOException("String_Node_Str");
    }
    final org.apache.hadoop.security.token.Token<?> tokens[]=fs.addDelegationTokens(tokenRenewer,credentials);
    if (tokens != null) {
      for (      org.apache.hadoop.security.token.Token<?> token : tokens) {
        LOGGER.logInfo("String_Node_Str" + fs.getUri() + "String_Node_Str"+ token);
      }
    }
    DataOutputBuffer dob=new DataOutputBuffer();
    credentials.writeTokenStorageToStream(dob);
    fsTokens=ByteBuffer.wrap(dob.getData(),0,dob.getLength());
  }
  return ContainerLaunchContext.newInstance(localResources,localEnvs,commands,null,fsTokens,null);
}