Program: 94569
Project: 94569
Buggy source:
public int HTTPGetFile(String url_,String destination_,Gui gui_,String status_) throws FermeExceptionNoSpaceLeftOnDevice {
  try {
    HttpURLConnection httpCon=this.HTTPRequest(url_);
    InputStream inStrm=httpCon.getInputStream();
    if (httpCon.getResponseCode() != HttpURLConnection.HTTP_OK) {
      this.log.error("String_Node_Str" + url_ + "String_Node_Str"+ HttpURLConnection.HTTP_OK+ "String_Node_Str"+ httpCon.getResponseCode());
      return -1;
    }
    int size=httpCon.getContentLength();
    long start=new Date().getTime();
    FileOutputStream fos=new FileOutputStream(destination_);
    byte[] ch=new byte[512 * 1024];
    int nb;
    long written=0;
    long last_gui_update=0;
    while ((nb=inStrm.read(ch)) != -1) {
      fos.write(ch,0,nb);
      written+=nb;
      if ((written - last_gui_update) > 1000000) {
        gui_.status(String.format(status_,(int)(100.0 * written / size)));
        last_gui_update=written;
      }
    }
    fos.close();
    inStrm.close();
    long end=new Date().getTime();
    this.log.debug(String.format("String_Node_Str",((float)(size / 1000)) / ((float)(end - start) / 1000),written));
    this.lastRequestTime=new Date().getTime();
    return 0;
  }
 catch (  Exception e) {
    if (Utils.noFreeSpaceOnDisk(destination_)) {
      throw new FermeExceptionNoSpaceLeftOnDevice();
    }
    StringWriter sw=new StringWriter();
    e.printStackTrace(new PrintWriter(sw));
    this.log.error("String_Node_Str" + e + "String_Node_Str"+ sw.toString());
  }
  this.log.debug("String_Node_Str" + url_ + "String_Node_Str");
  return -2;
}

Fixed version (ground truth):
public int HTTPGetFile(String url_,String destination_,Gui gui_,String status_) throws FermeExceptionNoSpaceLeftOnDevice {
  try {
    HttpURLConnection httpCon=this.HTTPRequest(url_);
    InputStream inStrm=httpCon.getInputStream();
    if (httpCon.getResponseCode() != HttpURLConnection.HTTP_OK) {
      this.log.error("String_Node_Str" + url_ + "String_Node_Str"+ HttpURLConnection.HTTP_OK+ "String_Node_Str"+ httpCon.getResponseCode());
      return -1;
    }
    int size=httpCon.getContentLength();
    long start=new Date().getTime();
    FileOutputStream fos=new FileOutputStream(destination_);
    byte[] ch=new byte[512 * 1024];
    int nb;
    long written=0;
    long last_gui_update=0;
    while ((nb=inStrm.read(ch)) != -1) {
      fos.write(ch,0,nb);
      written+=nb;
      if ((written - last_gui_update) > 1000000) {
        gui_.status(String.format(status_,(int)(100.0 * written / size)));
        last_gui_update=written;
      }
    }
    fos.close();
    inStrm.close();
    long end=new Date().getTime();
    this.log.debug(String.format("String_Node_Str",((float)(size / 1000)) / ((float)(end - start) / 1000),written));
    this.lastRequestTime=new Date().getTime();
    return 0;
  }
 catch (  Exception e) {
    if (Utils.noFreeSpaceOnDisk(new File(destination_).getParent())) {
      throw new FermeExceptionNoSpaceLeftOnDevice();
    }
    StringWriter sw=new StringWriter();
    e.printStackTrace(new PrintWriter(sw));
    this.log.error("String_Node_Str" + e + "String_Node_Str"+ sw.toString());
  }
  this.log.debug("String_Node_Str" + url_ + "String_Node_Str");
  return -2;
}