Program: 33153
Project: 33153
Buggy source:
private List<Path> downloadUpdates(LinkedList<UFXProtocol.Update> updates,long bytesToFetch) throws URISyntaxException, IOException, Ex {
  LinkedList<Path> files=new LinkedList<>();
  if (updates.isEmpty())   return files;
  Updater.this.updateProgress(0,bytesToFetch);
  for (  UFXProtocol.Update update : updates) {
    if (update.getUrlsCount() == 0)     throw new IllegalStateException("String_Node_Str");
    URI url=new URI(update.getUrls((int)(update.getUrlsCount() * Math.random())));
    url=maybeOverrideBaseURL(url);
    log.info("String_Node_Str",url);
    URLConnection connection=openURL(url);
    long size=connection.getContentLengthLong();
    long initialBytesRead=totalBytesDownloaded;
    try (InputStream netStream=connection.getInputStream()){
      BufferedInputStream bufStream=new BufferedInputStream(netStream);
      ProgressCalculatingStream stream=new ProgressCalculatingStream(bufStream,size){
        @Override protected void updateProgress(        long readSoFar,        long expectedBytes,        double progress){
          log.info(String.format("String_Node_Str",progress * 100));
          totalBytesDownloaded=initialBytesRead + readSoFar;
          Updater.this.updateProgress(totalBytesDownloaded,bytesToFetch);
        }
      }
;
      Path tmpDir=localUpdatesDir.resolve("String_Node_Str");
      if (!isDirectory(tmpDir))       createDirectory(tmpDir);
      Path outfile=tmpDir.resolve(update.getVersion() + "String_Node_Str");
      deleteIfExists(outfile);
      log.info("String_Node_Str",outfile);
      byte[] sha256;
      try (HashingOutputStream savedFile=hashingFileStream(outfile)){
        ByteStreams.copy(stream,savedFile);
        sha256=savedFile.hash().asBytes();
      }
       if (Arrays.equals(update.getPatchHash().toByteArray(),sha256)) {
        files.add(outfile);
      }
 else {
        log.error("String_Node_Str",BaseEncoding.base16().lowerCase().encode(sha256),BaseEncoding.base16().lowerCase().encode(update.getPatchHash().toByteArray()));
        throw new Ex.BadUpdateHash();
      }
    }
   }
  return files;
}

Fixed version (ground truth):
private List<Path> downloadUpdates(LinkedList<UFXProtocol.Update> updates,long bytesToFetch) throws URISyntaxException, IOException, Ex {
  LinkedList<Path> files=new LinkedList<>();
  if (updates.isEmpty())   return files;
  updateProgress(0,bytesToFetch);
  for (  UFXProtocol.Update update : updates) {
    if (update.getUrlsCount() == 0)     throw new IllegalStateException("String_Node_Str");
    URI url=new URI(update.getUrls((int)(update.getUrlsCount() * Math.random())));
    url=maybeOverrideBaseURL(url);
    log.info("String_Node_Str",url);
    URLConnection connection=openURL(url);
    long size=connection.getContentLengthLong();
    long initialBytesRead=totalBytesDownloaded;
    try (InputStream netStream=connection.getInputStream()){
      BufferedInputStream bufStream=new BufferedInputStream(netStream);
      ProgressCalculatingStream stream=new ProgressCalculatingStream(bufStream,size){
        @Override protected void updateProgress(        long readSoFar,        long expectedBytes,        double progress){
          log.info(String.format("String_Node_Str",progress * 100));
          totalBytesDownloaded=initialBytesRead + readSoFar;
          Updater.this.updateProgress(totalBytesDownloaded,bytesToFetch);
        }
      }
;
      Path tmpDir=localUpdatesDir.resolve("String_Node_Str");
      if (!isDirectory(tmpDir))       createDirectory(tmpDir);
      Path outfile=tmpDir.resolve(update.getVersion() + "String_Node_Str");
      deleteIfExists(outfile);
      log.info("String_Node_Str",outfile);
      byte[] sha256;
      try (HashingOutputStream savedFile=hashingFileStream(outfile)){
        ByteStreams.copy(stream,savedFile);
        sha256=savedFile.hash().asBytes();
      }
       if (Arrays.equals(update.getPatchHash().toByteArray(),sha256)) {
        files.add(outfile);
      }
 else {
        log.error("String_Node_Str",BaseEncoding.base16().lowerCase().encode(sha256),BaseEncoding.base16().lowerCase().encode(update.getPatchHash().toByteArray()));
        throw new Ex.BadUpdateHash();
      }
    }
   }
  return files;
}