Program: 5604
Project: 5604
Buggy source:
private void handlePendingConnections(){
  while (true) {
    TCPConnection connection=null;
synchronized (this) {
      while (pending.size() == 0)       try {
        System.out.println("String_Node_Str");
        wait();
        System.out.println("String_Node_Str");
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
      connection=(TCPConnection)pending.firstElement();
      pending.removeElementAt(0);
    }
    InputStream input=connection.getInputStream();
    OutputStream output=connection.getOutputStream();
    connection.setTimeout(5000);
    try {
      System.out.println("String_Node_Str" + input);
      String reqLine=readLine(input);
      reqLine=reqLine.trim();
      int space=reqLine.indexOf(' ');
      if (space == -1) {
        return;
      }
      String method=reqLine.substring(0,space);
      String path=reqLine.substring(space + 1,reqLine.lastIndexOf(' '));
      System.out.println("String_Node_Str" + method);
      System.out.println("String_Node_Str" + path);
      int query=reqLine.indexOf('?');
      if (query > 0) {
        path=path.substring(0,query);
      }
      HttpServlet servlet=(HttpServlet)servlets.get(path);
      if (servlet == null) {
        output.write("String_Node_Str".getBytes());
        output.close();
        input.close();
        connection.close();
      }
 else {
        String line=null;
        while ((line=readLine(input)) != null) {
          line=line.trim();
          System.out.println("String_Node_Str" + line);
          if (line.length() == 0) {
            break;
          }
        }
        HttpServletRequest req=new HttpServletRequest(connection,method,path);
        HttpServletResponse resp=new HttpServletResponse(connection);
        servlet.service(req,resp);
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
 finally {
      try {
        output.close();
      }
 catch (      IOException e) {
      }
      connection.close();
    }
  }
}

Fixed version (ground truth):
private void handlePendingConnections(){
  while (true) {
    TCPConnection connection=null;
synchronized (this) {
      while (pending.size() == 0)       try {
        System.out.println("String_Node_Str");
        status="String_Node_Str";
        wait();
        System.out.println("String_Node_Str");
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
      status="String_Node_Str";
      connection=(TCPConnection)pending.firstElement();
      pending.removeElementAt(0);
    }
    InputStream input=connection.getInputStream();
    OutputStream output=connection.getOutputStream();
    connection.setTimeout(5000);
    try {
      System.out.println("String_Node_Str" + input);
      status="String_Node_Str";
      String reqLine=readLine(input);
      reqLine=reqLine.trim();
      if (!handleRequest(reqLine,input,output,connection)) {
        output.write("String_Node_Str".getBytes());
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
 finally {
      try {
        output.close();
        input.close();
      }
 catch (      IOException e) {
      }
      connection.close();
    }
  }
}