Program: 4897
Project: 4897
Buggy source:
/** 
 * Test requests by URN.
 */
public void testHttpUrnRequest(){
  for (int i=0; i < _fileManager.getNumFiles(); i++) {
    try {
      FileDesc fd=_fileManager.get(i);
      ByteArrayOutputStream baos=new ByteArrayOutputStream();
      baos.write("String_Node_Str".getBytes());
      baos.write(fd.getSHA1Urn().toString().getBytes());
      baos.write("String_Node_Str".getBytes());
      Socket sock=new TestSocket(new ByteArrayInputStream(baos.toByteArray()));
      _uploadManager.acceptUpload(sock);
      String reply=sock.getOutputStream().toString();
      StringTokenizer st=new StringTokenizer("String_Node_Str");
      while (st.hasMoreTokens()) {
        String curString=st.nextToken();
        if (HTTPHeaderName.ALT_LOCATION.matchesStartOfString(curString)) {
          continue;
        }
 else         if (HTTPHeaderName.CONTENT_URN.matchesStartOfString(curString)) {
          URN curUrn=null;
          try {
            curUrn=URNFactory.createUrnFromContentUrnHttpHeader(curString);
          }
 catch (          IOException e) {
            assertTrue("String_Node_Str" + e,false);
          }
          assertEquals(HTTPHeaderName.CONTENT_URN.toString() + "String_Node_Str",fd.getSHA1Urn(),curUrn);
        }
 else         if (HTTPHeaderName.CONTENT_RANGE.matchesStartOfString(curString)) {
          continue;
        }
 else         if (HTTPHeaderName.CONTENT_TYPE.matchesStartOfString(curString)) {
          String value=HTTPUtils.extractHeaderValue(curString);
          assertEquals("String_Node_Str",(int)fd.getSize(),Integer.parseInt(value));
        }
 else         if (HTTPHeaderName.SERVER.matchesStartOfString(curString)) {
          continue;
        }
      }
    }
 catch (    IOException e) {
      assertTrue("String_Node_Str" + e,false);
    }
  }
}

Fixed version (ground truth):
/** 
 * Test requests by URN.
 */
public void testHttpUrnRequest(){
  for (int i=0; i < _fileManager.getNumFiles(); i++) {
    try {
      FileDesc fd=_fileManager.get(i);
      ByteArrayOutputStream baos=new ByteArrayOutputStream();
      baos.write("String_Node_Str".getBytes());
      baos.write(fd.getSHA1Urn().toString().getBytes());
      baos.write("String_Node_Str".getBytes());
      Socket sock=new TestSocket(new ByteArrayInputStream(baos.toByteArray()));
      _uploadManager.acceptUpload(sock);
      String reply=sock.getOutputStream().toString();
      StringTokenizer st=new StringTokenizer(reply,"String_Node_Str");
      boolean contentUrnHeaderPresent=false;
      while (st.hasMoreTokens()) {
        String curString=st.nextToken();
        if (HTTPHeaderName.ALT_LOCATION.matchesStartOfString(curString)) {
          continue;
        }
 else         if (HTTPHeaderName.CONTENT_URN.matchesStartOfString(curString)) {
          URN curUrn=null;
          try {
            curUrn=URNFactory.createUrnFromContentUrnHttpHeader(curString);
          }
 catch (          IOException e) {
            assertTrue("String_Node_Str" + e,false);
          }
          assertEquals(HTTPHeaderName.CONTENT_URN.toString() + "String_Node_Str",fd.getSHA1Urn(),curUrn);
          contentUrnHeaderPresent=true;
        }
 else         if (HTTPHeaderName.CONTENT_RANGE.matchesStartOfString(curString)) {
          continue;
        }
 else         if (HTTPHeaderName.CONTENT_TYPE.matchesStartOfString(curString)) {
          continue;
        }
 else         if (HTTPHeaderName.CONTENT_LENGTH.matchesStartOfString(curString)) {
          String value=HTTPUtils.extractHeaderValue(curString);
          assertEquals("String_Node_Str",(int)fd.getSize(),Integer.parseInt(value));
        }
 else         if (HTTPHeaderName.SERVER.matchesStartOfString(curString)) {
          continue;
        }
      }
      assertTrue("String_Node_Str" + fd,contentUrnHeaderPresent);
    }
 catch (    IOException e) {
      assertTrue("String_Node_Str" + e,false);
    }
  }
}