Program: 53197
Project: 53197
Buggy source:
private CacheResult tryToFetchArtifactFromBuildCacheAndOverlayOnTopOfProjectFilesystem(BuildRule rule,RuleKey ruleKey,BuildInfoRecorder buildInfoRecorder,ArtifactCache artifactCache,ProjectFilesystem filesystem,BuildContext buildContext) throws InterruptedException {
  File zipFile;
  try {
    zipFile=File.createTempFile("String_Node_Str" + MoreFiles.sanitize(rule.getBuildTarget().getShortName()),"String_Node_Str");
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
  CacheResult cacheResult=buildInfoRecorder.fetchArtifactForBuildable(ruleKey,zipFile,artifactCache);
  if (!cacheResult.getType().isSuccess()) {
    try {
      Files.delete(zipFile.toPath());
    }
 catch (    IOException e) {
      LOG.warn(e,"String_Node_Str",zipFile);
    }
    return cacheResult;
  }
  buildContext.getEventBus().post(ArtifactCacheEvent.started(ArtifactCacheEvent.Operation.DECOMPRESS,ImmutableSet.of(ruleKey)));
  try {
    Unzip.extractZipFile(zipFile.toPath().toAbsolutePath(),filesystem,Unzip.ExistingFileMode.OVERWRITE_AND_CLEAN_DIRECTORIES);
    Files.delete(zipFile.toPath());
    if (cacheResult.getType() == CacheResult.Type.HIT) {
      Path metadataDir=BuildInfo.getPathToMetadataDirectory(rule.getBuildTarget());
      for (      Map.Entry<String,String> ent : cacheResult.getMetadata().entrySet()) {
        Path dest=metadataDir.resolve(ent.getKey());
        filesystem.createParentDirs(dest);
        filesystem.writeContentsToPath(ent.getValue(),dest);
      }
    }
  }
 catch (  IOException e) {
    buildContext.getEventBus().post(ConsoleEvent.warning("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ rule.getBuildTarget(),zipFile.getAbsolutePath(),Throwables.getStackTraceAsString(e)));
    return CacheResult.miss();
  }
 finally {
    buildContext.getEventBus().post(ArtifactCacheEvent.finished(ArtifactCacheEvent.Operation.DECOMPRESS,ImmutableSet.of(rule.getRuleKey())));
  }
  return cacheResult;
}

Fixed version (ground truth):
private CacheResult tryToFetchArtifactFromBuildCacheAndOverlayOnTopOfProjectFilesystem(BuildRule rule,RuleKey ruleKey,BuildInfoRecorder buildInfoRecorder,ArtifactCache artifactCache,ProjectFilesystem filesystem,BuildContext buildContext) throws InterruptedException {
  File zipFile;
  try {
    zipFile=File.createTempFile("String_Node_Str" + MoreFiles.sanitize(rule.getBuildTarget().getShortName()),"String_Node_Str");
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
  CacheResult cacheResult=buildInfoRecorder.fetchArtifactForBuildable(ruleKey,zipFile,artifactCache);
  if (!cacheResult.getType().isSuccess()) {
    try {
      Files.delete(zipFile.toPath());
    }
 catch (    IOException e) {
      LOG.warn(e,"String_Node_Str",zipFile);
    }
    return cacheResult;
  }
  buildContext.getEventBus().post(ArtifactCacheEvent.started(ArtifactCacheEvent.Operation.DECOMPRESS,ImmutableSet.of(ruleKey)));
  try {
    ImmutableList<Path> unpacked=Unzip.extractZipFile(zipFile.toPath().toAbsolutePath(),filesystem,Unzip.ExistingFileMode.OVERWRITE_AND_CLEAN_DIRECTORIES);
    Files.delete(zipFile.toPath());
    if (cacheResult.getType() == CacheResult.Type.HIT) {
      Path metadataDir=BuildInfo.getPathToMetadataDirectory(rule.getBuildTarget());
      for (      Map.Entry<String,String> ent : cacheResult.getMetadata().entrySet()) {
        Path dest=metadataDir.resolve(ent.getKey());
        filesystem.createParentDirs(dest);
        filesystem.writeContentsToPath(ent.getValue(),dest);
      }
      for (      Path input : unpacked) {
        buildInfoRecorder.recordArtifact(input);
      }
    }
  }
 catch (  IOException e) {
    buildContext.getEventBus().post(ConsoleEvent.warning("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ rule.getBuildTarget(),zipFile.getAbsolutePath(),Throwables.getStackTraceAsString(e)));
    return CacheResult.miss();
  }
 finally {
    buildContext.getEventBus().post(ArtifactCacheEvent.finished(ArtifactCacheEvent.Operation.DECOMPRESS,ImmutableSet.of(rule.getRuleKey())));
  }
  return cacheResult;
}