Program: 57011
Project: 57011
Buggy source:
@Override public void run(IProgressMonitor monitor){
  if (inCache()) {
    monitor.done();
    return;
  }
  successful=false;
  caught=null;
  File tmp=new File(file.getAbsolutePath() + "String_Node_Str");
  tmp.getParentFile().mkdirs();
  long lastModified=0;
  try (OutputStream out=new BufferedOutputStream(new FileOutputStream(tmp))){
    URLConnection connection=url.openConnection();
    connection.connect();
    int length=connection.getContentLength();
    lastModified=connection.getLastModified();
    if (length < 0)     length=IProgressMonitor.UNKNOWN;
    monitor.beginTask("String_Node_Str" + url,length);
    try (InputStream in=new BufferedInputStream(connection.getInputStream())){
      byte[] data=new byte[BUFFER_SIZE];
      int count=0;
      int acc=0;
      int i=0;
      while ((count=in.read(data)) != -1) {
        acc+=count;
        out.write(data,0,count);
        if (i++ >= WORK_TRIGGER_FREQUENCY) {
          i-=WORK_TRIGGER_FREQUENCY;
          if (monitor.isCanceled())           break;
          monitor.worked(acc);
          acc=0;
        }
      }
    }
     monitor.done();
    successful=true;
  }
 catch (  IOException e) {
    log.error("String_Node_Str" + url,e);
    caught=e;
  }
  if (successful) {
    try {
      Files.move(tmp.toPath(),file.toPath(),StandardCopyOption.REPLACE_EXISTING);
      if (lastModified != 0)       file.setLastModified(lastModified);
      RemoteFileCache.putToCache(url,file);
    }
 catch (    IOException e) {
      log.error("String_Node_Str" + url,e);
      caught=e;
    }
  }
 else {
    tmp.delete();
  }
}

Fixed version (ground truth):
@Override public void run(IProgressMonitor monitor){
  if (inCache(false)) {
    monitor.done();
    return;
  }
  successful=false;
  caught=null;
  File tmp=new File(file.getAbsolutePath() + "String_Node_Str");
  tmp.getParentFile().mkdirs();
  long lastModified=0;
  try (OutputStream out=new BufferedOutputStream(new FileOutputStream(tmp))){
    URLConnection connection=url.openConnection();
    connection.connect();
    int length=connection.getContentLength();
    lastModified=connection.getLastModified();
    if (length < 0)     length=IProgressMonitor.UNKNOWN;
    monitor.beginTask("String_Node_Str" + url,length);
    try (InputStream in=new BufferedInputStream(connection.getInputStream())){
      byte[] data=new byte[BUFFER_SIZE];
      int count=0;
      int acc=0;
      int i=0;
      while ((count=in.read(data)) != -1) {
        acc+=count;
        out.write(data,0,count);
        if (i++ >= WORK_TRIGGER_FREQUENCY) {
          i-=WORK_TRIGGER_FREQUENCY;
          if (monitor.isCanceled())           break;
          monitor.worked(acc);
          acc=0;
        }
      }
    }
     monitor.done();
    successful=true;
  }
 catch (  IOException e) {
    log.error("String_Node_Str" + url,e);
    caught=e;
  }
  if (successful) {
    try {
      Files.move(tmp.toPath(),file.toPath(),StandardCopyOption.REPLACE_EXISTING);
      if (lastModified != 0)       file.setLastModified(lastModified);
      RemoteFileCache.putToCache(url,file);
    }
 catch (    IOException e) {
      log.error("String_Node_Str" + url,e);
      caught=e;
    }
  }
 else {
    tmp.delete();
  }
}