Program: 4644
Project: 4644
Buggy source:
/** 
 * Accepts a new upload, creating a new <tt>HTTPUploader</tt> if it successfully parses the HTTP request.  BLOCKING.
 * @param method the initial request type to use, e.g., GET or HEAD
 * @param socket the <tt>Socket</tt> that will be used for the new upload.It is assumed that the initial word of the request (e.g., "GET") has been consumed (e.g., by Acceptor)
 * @param forceAllow forces the UploadManager to allow all requestson this socket to take place.
 */
public void acceptUpload(final HTTPRequestMethod method,Socket socket,boolean forceAllow){
  debug("String_Node_Str");
  HTTPUploader uploader=null;
  try {
    int queued=-1;
    String oldFileName="String_Node_Str";
    HTTPRequestMethod currentMethod=method;
    StalledUploadWatchdog watchdog=new StalledUploadWatchdog();
    while (true) {
      HttpRequestLine line=parseHttpRequest(socket);
      debug("String_Node_Str");
      String fileName=line._fileName;
      if (uploader != null && shouldShowInGUI(uploader) && !oldFileName.equalsIgnoreCase(fileName)) {
        RouterService.getCallback().removeUpload(uploader);
      }
      removeFromList(uploader);
      uploader=new HTTPUploader(currentMethod,fileName,socket,line._index,uploader,watchdog);
      uploader.readHeader();
      debug(uploader + "String_Node_Str");
      boolean giveSlot=(oldFileName.equalsIgnoreCase(fileName) && queued == ACCEPTED);
      giveSlot|=forceAllow;
      queued=doSingleUpload(uploader,socket,socket.getInetAddress().getHostAddress(),line._index,giveSlot);
      oldFileName=fileName;
      if ((!line.isHTTP11() || uploader.getCloseConnection()) && queued != QUEUED)       return;
      debug(uploader + "String_Node_Str");
      int oldTimeout=socket.getSoTimeout();
      if (queued != QUEUED)       socket.setSoTimeout(SettingsManager.instance().getPersistentHTTPConnectionTimeout());
      String word=IOUtils.readWord(socket.getInputStream(),4);
      debug(uploader + "String_Node_Str");
      socket.setSoTimeout(oldTimeout);
      if (word.equals("String_Node_Str"))       currentMethod=HTTPRequestMethod.GET;
 else       if (word.equals("String_Node_Str"))       currentMethod=HTTPRequestMethod.HEAD;
 else       return;
    }
  }
 catch (  IOException ioe) {
    debug("String_Node_Str");
  }
catch (  ArrayIndexOutOfBoundsException ae) {
    debug("String_Node_Str");
  }
 finally {
synchronized (this) {
      removeFromList(uploader);
      boolean found=false;
      for (Iterator iter=_queuedUploads.iterator(); iter.hasNext(); ) {
        KeyValue kv=(KeyValue)iter.next();
        if (kv.getKey() == socket) {
          found=true;
          iter.remove();
        }
      }
      if (found)       uploader.setState(Uploader.INTERRUPTED);
    }
    if (uploader != null && shouldShowInGUI(uploader))     RouterService.getCallback().removeUpload(uploader);
    debug("String_Node_Str");
    close(socket);
  }
}

Fixed version (ground truth):
/** 
 * Accepts a new upload, creating a new <tt>HTTPUploader</tt> if it successfully parses the HTTP request.  BLOCKING.
 * @param method the initial request type to use, e.g., GET or HEAD
 * @param socket the <tt>Socket</tt> that will be used for the new upload.It is assumed that the initial word of the request (e.g., "GET") has been consumed (e.g., by Acceptor)
 * @param forceAllow forces the UploadManager to allow all requestson this socket to take place.
 */
public void acceptUpload(final HTTPRequestMethod method,Socket socket,boolean forceAllow){
  debug("String_Node_Str");
  HTTPUploader uploader=null;
  try {
    int queued=-1;
    String oldFileName="String_Node_Str";
    HTTPRequestMethod currentMethod=method;
    StalledUploadWatchdog watchdog=new StalledUploadWatchdog();
    while (true) {
      HttpRequestLine line=parseHttpRequest(socket);
      debug("String_Node_Str");
      String fileName=line._fileName;
      if (uploader != null && shouldShowInGUI(uploader) && !oldFileName.equalsIgnoreCase(fileName)) {
        RouterService.getCallback().removeUpload(uploader);
      }
      removeFromList(uploader);
      uploader=new HTTPUploader(currentMethod,fileName,socket,line._index,uploader,watchdog);
      uploader.readHeader();
      debug(uploader + "String_Node_Str");
      boolean giveSlot=(oldFileName.equalsIgnoreCase(fileName) && queued == ACCEPTED);
      giveSlot|=forceAllow;
      queued=doSingleUpload(uploader,socket,socket.getInetAddress().getHostAddress(),line._index,giveSlot);
      oldFileName=fileName;
      if ((!line.isHTTP11() || uploader.getCloseConnection()) && queued != QUEUED)       return;
      debug(uploader + "String_Node_Str");
      int oldTimeout=socket.getSoTimeout();
      if (queued != QUEUED)       socket.setSoTimeout(SettingsManager.instance().getPersistentHTTPConnectionTimeout());
      String word=IOUtils.readWord(socket.getInputStream(),4);
      debug(uploader + "String_Node_Str");
      socket.setSoTimeout(oldTimeout);
      if (word.equals("String_Node_Str"))       currentMethod=HTTPRequestMethod.GET;
 else       if (word.equals("String_Node_Str"))       currentMethod=HTTPRequestMethod.HEAD;
 else       return;
    }
  }
 catch (  IOException ioe) {
    debug("String_Node_Str");
  }
catch (  ArrayIndexOutOfBoundsException ae) {
    debug("String_Node_Str");
  }
 finally {
    if (uploader != null && uploader.getState() != Uploader.COMPLETE)     uploader.setState(Uploader.INTERRUPTED);
synchronized (this) {
      removeFromList(uploader);
      boolean found=false;
      for (Iterator iter=_queuedUploads.iterator(); iter.hasNext(); ) {
        KeyValue kv=(KeyValue)iter.next();
        if (kv.getKey() == socket) {
          found=true;
          iter.remove();
        }
      }
    }
    if (uploader != null && shouldShowInGUI(uploader))     RouterService.getCallback().removeUpload(uploader);
    debug("String_Node_Str");
    close(socket);
  }
}