Program: 80232
Project: 80232
Buggy source:
@VisibleForTesting protected void localizeConfigFiles(ContainerLauncher launcher,String roleName,String roleGroup,Metainfo metainfo,Map<String,Map<String,String>> configs,MapOperations env,SliderFileSystem fileSystem,ConfTreeOperations appConf) throws IOException {
  for (  ConfigFile configFile : metainfo.getComponentConfigFiles(roleGroup)) {
    Map<String,String> config=ConfigUtils.replacePropsInConfig(configs.get(configFile.getDictionaryName()),env.options);
    String fileName=ConfigUtils.replaceProps(config,configFile.getFileName());
    File localFile=new File(SliderKeys.RESOURCE_DIR);
    if (!localFile.exists()) {
      localFile.mkdir();
    }
    localFile=new File(localFile,new File(fileName).getName());
    boolean perComponent=appConf.getComponentOptBool(roleGroup,"String_Node_Str" + configFile.getDictionaryName() + PER_COMPONENT,false);
    boolean perGroup=appConf.getComponentOptBool(roleGroup,"String_Node_Str" + configFile.getDictionaryName() + PER_GROUP,false);
    String folder=null;
    if (perComponent) {
      folder=roleName;
    }
 else     if (perGroup) {
      folder=roleGroup;
    }
    log.info("String_Node_Str" + "String_Node_Str",config.size(),localFile,fileName,configFile.getDictionaryName());
    createConfigFile(fileSystem,localFile,configFile,config);
    Path destPath=uploadResource(localFile,fileSystem,folder);
    LocalResource configResource=fileSystem.createAmResource(destPath,LocalResourceType.FILE);
    File destFile=new File(fileName);
    if (destFile.isAbsolute()) {
      launcher.addLocalResource(SliderKeys.RESOURCE_DIR + "String_Node_Str" + destFile.getName(),configResource,fileName);
    }
 else {
      launcher.addLocalResource(AgentKeys.APP_CONF_DIR + "String_Node_Str" + fileName,configResource);
    }
  }
}

Fixed version (ground truth):
@VisibleForTesting protected void localizeConfigFiles(ContainerLauncher launcher,String roleName,String roleGroup,Metainfo metainfo,Map<String,Map<String,String>> configs,MapOperations env,SliderFileSystem fileSystem,ConfTreeOperations appConf) throws IOException {
  for (  ConfigFile configFile : metainfo.getComponentConfigFiles(roleGroup)) {
    Map<String,String> config=ConfigUtils.replacePropsInConfig(configs.get(configFile.getDictionaryName()),env.options);
    String fileName=ConfigUtils.replaceProps(config,configFile.getFileName());
    File localFile=new File(SliderKeys.RESOURCE_DIR);
    if (!localFile.exists()) {
      if (!localFile.mkdir() && !localFile.exists()) {
        throw new IOException(RESOURCE_DIR + "String_Node_Str");
      }
    }
    boolean perComponent=appConf.getComponentOptBool(roleGroup,"String_Node_Str" + configFile.getDictionaryName() + PER_COMPONENT,false);
    boolean perGroup=appConf.getComponentOptBool(roleGroup,"String_Node_Str" + configFile.getDictionaryName() + PER_GROUP,false);
    String folder=null;
    if (perComponent) {
      folder=roleName;
    }
 else     if (perGroup) {
      folder=roleGroup;
    }
    if (folder != null) {
      localFile=new File(localFile,folder);
      if (!localFile.exists()) {
        if (!localFile.mkdir() && !localFile.exists()) {
          throw new IOException(localFile + "String_Node_Str");
        }
      }
    }
    localFile=new File(localFile,new File(fileName).getName());
    log.info("String_Node_Str" + "String_Node_Str",config.size(),localFile,fileName,configFile.getDictionaryName());
    if (!localFile.exists()) {
      createConfigFile(fileSystem,localFile,configFile,config);
    }
 else {
      log.info("String_Node_Str",configFile.getType(),localFile);
    }
    Path destPath=uploadResource(localFile,fileSystem,folder);
    LocalResource configResource=fileSystem.createAmResource(destPath,LocalResourceType.FILE);
    File destFile=new File(fileName);
    if (destFile.isAbsolute()) {
      launcher.addLocalResource(SliderKeys.RESOURCE_DIR + "String_Node_Str" + destFile.getName(),configResource,fileName);
    }
 else {
      launcher.addLocalResource(AgentKeys.APP_CONF_DIR + "String_Node_Str" + fileName,configResource);
    }
  }
}