Program: 21262
Project: 21262
Buggy source:
public HTTPConnection connect() throws Exception {
  if (request == null)   throw new IllegalStateException("String_Node_Str");
  this.connected=true;
  if (this.isResume() && this.checkResumabled()) {
    connectResumable();
  }
 else {
    if (this.isFileSizeVerified()) {
      int tmp=Math.min(Math.max(1,(int)(downloadLink.getDownloadSize() / Chunk.MIN_CHUNKSIZE)),getChunkNum());
      tmp=Math.min(tmp,plugin.getFreeConnections());
      if (tmp != getChunkNum()) {
        logger.finer("String_Node_Str" + getChunkNum() + "String_Node_Str"+ tmp);
        setChunkNum(tmp);
      }
    }
    if (downloadLink.getDownloadSize() > 0 && this.getChunkNum() > 1 && !this.isFirstChunkRangeless()) {
      connectFirstRange();
    }
 else {
      request.getHeaders().remove("String_Node_Str");
      request.connect();
    }
  }
  if (this.plugin.getBrowser().isDebug())   logger.finest(request.printHeaders());
  if (request.getLocation() != null) {
    throw new PluginException(LinkStatus.ERROR_DOWNLOAD_FAILED,DownloadInterface.ERROR_REDIRECTED);
  }
  connection=request.getHttpConnection();
  if (connection.getRange() != null) {
    if (connection.getRange()[2] > 0) {
      this.setFilesizeCheck(true);
      this.downloadLink.setDownloadSize(connection.getRange()[2]);
    }
  }
 else {
    if (connection.getContentLength() > 0) {
      this.setFilesizeCheck(true);
      this.downloadLink.setDownloadSize(connection.getContentLength());
    }
  }
  if (this.downloadLink.getFinalFileName() == null) {
    String name=Plugin.getFileNameFormHeader(connection);
    this.downloadLink.setFinalFileName(name);
  }
  fileSize=downloadLink.getDownloadSize();
  return connection;
}

Fixed version (ground truth):
public HTTPConnection connect() throws Exception {
  if (request == null)   throw new IllegalStateException("String_Node_Str");
  this.connected=true;
  if (this.isResume() && this.checkResumabled()) {
    connectResumable();
  }
 else {
    if (this.isFileSizeVerified()) {
      int tmp=Math.min(Math.max(1,(int)(downloadLink.getDownloadSize() / Chunk.MIN_CHUNKSIZE)),getChunkNum());
      tmp=Math.min(tmp,plugin.getFreeConnections());
      if (tmp != getChunkNum()) {
        logger.finer("String_Node_Str" + getChunkNum() + "String_Node_Str"+ tmp);
        setChunkNum(tmp);
      }
    }
    if (this.isFileSizeVerified() && downloadLink.getDownloadSize() > 0 && this.getChunkNum() > 1 && !this.isFirstChunkRangeless()) {
      connectFirstRange();
    }
 else {
      request.getHeaders().remove("String_Node_Str");
      request.connect();
    }
  }
  if (this.plugin.getBrowser().isDebug())   logger.finest(request.printHeaders());
  if (request.getLocation() != null) {
    throw new PluginException(LinkStatus.ERROR_DOWNLOAD_FAILED,DownloadInterface.ERROR_REDIRECTED);
  }
  connection=request.getHttpConnection();
  if (connection.getRange() != null) {
    if (connection.getRange()[2] > 0) {
      this.setFilesizeCheck(true);
      this.downloadLink.setDownloadSize(connection.getRange()[2]);
    }
  }
 else {
    if (connection.getContentLength() > 0) {
      this.setFilesizeCheck(true);
      this.downloadLink.setDownloadSize(connection.getContentLength());
    }
  }
  if (this.downloadLink.getFinalFileName() == null) {
    String name=Plugin.getFileNameFormHeader(connection);
    this.downloadLink.setFinalFileName(name);
  }
  fileSize=downloadLink.getDownloadSize();
  return connection;
}