Program: 4652
Project: 4652
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)
 */
public void acceptUpload(final HTTPRequestMethod method,Socket socket){
  debug("String_Node_Str");
  HTTPUploader uploader=null;
  try {
    int queued=-1;
    String oldFileName="String_Node_Str";
    HTTPRequestMethod currentMethod=method;
    while (true) {
      HttpRequestLine line=parseHttpRequest(socket);
      debug("String_Node_Str");
      String fileName=line._fileName;
      if (uploader != null && uploader.getState() != Uploader.BROWSE_HOST && !oldFileName.equalsIgnoreCase(fileName)) {
        RouterService.getCallback().removeUpload(uploader);
      }
      removeFromList(uploader);
      uploader=new HTTPUploader(currentMethod,fileName,socket,line._index,uploader);
      uploader.readHeader();
      debug(uploader + "String_Node_Str");
      boolean giveSlot=(oldFileName.equalsIgnoreCase(fileName) && queued == ACCEPTED);
      if (giveSlot == false && (currentMethod == HTTPRequestMethod.HEAD)) {
        giveSlot=true;
      }
      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 && (uploader.getState() != uploader.BROWSE_HOST))     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)
 */
public void acceptUpload(final HTTPRequestMethod method,Socket socket){
  debug("String_Node_Str");
  HTTPUploader uploader=null;
  try {
    int queued=-1;
    String oldFileName="String_Node_Str";
    HTTPRequestMethod currentMethod=method;
    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);
      uploader.readHeader();
      debug(uploader + "String_Node_Str");
      boolean giveSlot=(oldFileName.equalsIgnoreCase(fileName) && queued == ACCEPTED);
      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);
  }
}