Program: 161935
Project: 161935
Buggy source:
private void replaceSkybox() throws IOException {
  Path tfpath=cfg.getTfPath();
  Set<Path> vmtPaths=new LinkedHashSet<>();
  Set<Path> vtfPaths=new LinkedHashSet<>();
  Path skyboxPath=tfpath.resolve("String_Node_Str");
  String skyboxVpk="String_Node_Str";
  String skyboxFilename=cfg.getSkybox();
  try (DirectoryStream<Path> stream=Files.newDirectoryStream(Paths.get("String_Node_Str"))){
    for (    Path path : stream) {
      String pathStr=path.toFile().getName();
      if (pathStr.endsWith("String_Node_Str")) {
        Files.copy(path,skyboxPath.resolve(pathStr));
        vmtPaths.add(path);
      }
      if (pathStr.endsWith("String_Node_Str") && pathStr.startsWith(skyboxFilename)) {
        vtfPaths.add(path);
      }
    }
  }
   for (  String pathStr : cl.getVpkContents(tfpath,Paths.get(skyboxVpk))) {
    Path path=Paths.get("String_Node_Str",pathStr);
    if (pathStr.endsWith("String_Node_Str")) {
      cl.extractIfNeeded(tfpath,skyboxVpk,Paths.get("String_Node_Str"),pathStr);
      Files.copy(path,skyboxPath.resolve(pathStr));
      vmtPaths.add(path);
    }
    if (pathStr.endsWith("String_Node_Str") && pathStr.startsWith(skyboxFilename)) {
      vtfPaths.add(path);
    }
  }
  for (  Path vtfPath : vtfPaths) {
    for (    Path vmtPath : vmtPaths) {
      String vtf=vtfPath.getFileName().toString();
      String vmt=vmtPath.getFileName().toString();
      if ((vtf.endsWith("String_Node_Str") && vmt.endsWith("String_Node_Str")) || (vtf.endsWith("String_Node_Str") && vmt.endsWith("String_Node_Str")) || (vtf.endsWith("String_Node_Str") && vmt.endsWith("String_Node_Str"))|| (vtf.endsWith("String_Node_Str") && vmt.endsWith("String_Node_Str"))|| (vtf.endsWith("String_Node_Str") && vmt.endsWith("String_Node_Str"))|| (vtf.endsWith("String_Node_Str") && vmt.endsWith("String_Node_Str"))) {
        cl.extractIfNeeded(tfpath,skyboxVpk,Paths.get("String_Node_Str"),vtfPath.getFileName().toString());
        Files.copy(vtfPath,skyboxPath.resolve(vmt.substring(0,vmt.indexOf("String_Node_Str")) + "String_Node_Str"));
      }
    }
  }
}

Fixed version (ground truth):
private void replaceSkybox() throws IOException {
  Path tfpath=cfg.getTfPath();
  Set<Path> vmtPaths=new LinkedHashSet<>();
  Set<Path> vtfPaths=new LinkedHashSet<>();
  Path skyboxPath=tfpath.resolve("String_Node_Str");
  String skyboxVpk="String_Node_Str";
  String skyboxFilename=cfg.getSkybox();
  try (DirectoryStream<Path> stream=Files.newDirectoryStream(Paths.get("String_Node_Str"))){
    for (    Path path : stream) {
      String pathStr=path.toFile().getName();
      if (pathStr.endsWith("String_Node_Str")) {
        Files.copy(path,skyboxPath.resolve(pathStr));
        vmtPaths.add(path);
      }
      if (pathStr.endsWith("String_Node_Str") && pathStr.startsWith(skyboxFilename)) {
        vtfPaths.add(path);
      }
    }
  }
   for (  String pathStr : cl.getVpkContents(tfpath,Paths.get(skyboxVpk))) {
    Path path=Paths.get("String_Node_Str",pathStr);
    if (pathStr.endsWith("String_Node_Str")) {
      cl.extractIfNeeded(tfpath,skyboxVpk,Paths.get("String_Node_Str"),pathStr);
      Files.copy(path,skyboxPath.resolve(pathStr),StandardCopyOption.REPLACE_EXISTING);
      vmtPaths.add(path);
    }
    if (pathStr.endsWith("String_Node_Str") && pathStr.startsWith(skyboxFilename)) {
      vtfPaths.add(path);
    }
  }
  for (  Path vtfPath : vtfPaths) {
    for (    Path vmtPath : vmtPaths) {
      String vtf=vtfPath.getFileName().toString();
      String vmt=vmtPath.getFileName().toString();
      if ((vtf.endsWith("String_Node_Str") && vmt.endsWith("String_Node_Str")) || (vtf.endsWith("String_Node_Str") && vmt.endsWith("String_Node_Str")) || (vtf.endsWith("String_Node_Str") && vmt.endsWith("String_Node_Str"))|| (vtf.endsWith("String_Node_Str") && vmt.endsWith("String_Node_Str"))|| (vtf.endsWith("String_Node_Str") && vmt.endsWith("String_Node_Str"))|| (vtf.endsWith("String_Node_Str") && vmt.endsWith("String_Node_Str"))) {
        cl.extractIfNeeded(tfpath,skyboxVpk,Paths.get("String_Node_Str"),vtfPath.getFileName().toString());
        Files.copy(vtfPath,skyboxPath.resolve(vmt.substring(0,vmt.indexOf("String_Node_Str")) + "String_Node_Str"));
      }
    }
  }
}