Program: 5620
Project: 5620
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();
    try {
      System.out.println("String_Node_Str" + input);
      String reqLine=readLine(input);
      reqLine=reqLine.trim();
      int space=reqLine.indexOf(' ');
      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 (    IOException 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");
        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();
    }
  }
}