Program: 35822
Project: 35822
Buggy source:
/** 
 * Compares a response to a file
 * @param relativePath Relative path of a folder on the server
 * @throws Exception In case of a problem
 */
public void assertBodyEqualsLocalFile(String relativePath) throws Exception {
  String directoryPrefix=getReferenceFilePath(relativePath);
  File file=new File(directoryPrefix);
  HttpTestCase.log.info("String_Node_Str" + file.getPath());
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  InputStream stream=new FileInputStream(file);
  byte[] buffer=new byte[1024];
  while (stream.available() > 0) {
    int read=stream.read(buffer);
    baos.write(buffer,0,read);
  }
  stream.close();
  byte[] data=baos.toByteArray();
  if (!Arrays.equals(httpMethod.getResponseBody(),data)) {
    String charset;
    Header[] contentTypes=httpMethod.getRequestHeaders("String_Node_Str");
    if (contentTypes.length > 0 && contentTypes[0].getValue().toLowerCase().contains("String_Node_Str"))     charset="String_Node_Str";
 else     charset="String_Node_Str";
    String expected=new String(data,charset);
    String actual=new String(httpMethod.getResponseBody(),charset);
    int index=0;
    int size=Math.min(expected.length(),actual.length());
    int line=1;
    int character=1;
    String expectedLine="String_Node_Str";
    String actualLine="String_Node_Str";
    while (index < size) {
      if (expected.charAt(index) == '\n' && actual.charAt(index) == '\n') {
        line++;
        character=1;
        expectedLine="String_Node_Str";
        actualLine="String_Node_Str";
      }
 else {
        character++;
        expectedLine+=expected.charAt(index);
        actualLine+=actual.charAt(index);
      }
      if (expected.charAt(index) != actual.charAt(index)) {
        String message="String_Node_Str" + getMethodURI() + "String_Node_Str";
        message+="String_Node_Str" + line + "String_Node_Str"+ character+ "String_Node_Str";
        index++;
        while (expected.charAt(index) != '\n' && actual.charAt(index) != '\n' && index < size) {
          expectedLine+=expected.charAt(index);
          actualLine+=actual.charAt(index);
          index++;
        }
        message+="String_Node_Str" + expectedLine + "String_Node_Str";
        message+="String_Node_Str" + actualLine + "String_Node_Str";
        throw new AssertionFailedError(message);
      }
      index++;
    }
  }
}

Fixed version (ground truth):
/** 
 * Compares a response to a file
 * @param relativePath Relative path of a folder on the server
 * @throws Exception In case of a problem
 */
public void assertBodyEqualsLocalFile(String relativePath) throws Exception {
  String directoryPrefix=getReferenceFilePath(relativePath);
  File file=new File(directoryPrefix);
  HttpTestCase.log.info("String_Node_Str" + file.getPath());
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  InputStream stream=new FileInputStream(file);
  byte[] buffer=new byte[1024];
  while (stream.available() > 0) {
    int read=stream.read(buffer);
    baos.write(buffer,0,read);
  }
  stream.close();
  byte[] data=baos.toByteArray();
  if (!Arrays.equals(httpMethod.getResponseBody(),data)) {
    String charset;
    Header[] contentTypes=httpMethod.getRequestHeaders("String_Node_Str");
    if (contentTypes.length > 0 && contentTypes[0].getValue().toLowerCase().contains("String_Node_Str"))     charset="String_Node_Str";
 else     charset="String_Node_Str";
    String expected=new String(data,charset);
    String actual=new String(httpMethod.getResponseBody(),charset);
    int index=0;
    int size=Math.min(expected.length(),actual.length());
    int line=1;
    int character=1;
    String expectedLine="String_Node_Str";
    String actualLine="String_Node_Str";
    while (index < size) {
      if (expected.charAt(index) == '\n' && actual.charAt(index) == '\n') {
        line++;
        character=1;
        expectedLine="String_Node_Str";
        actualLine="String_Node_Str";
      }
 else {
        character++;
        expectedLine+=expected.charAt(index);
        actualLine+=actual.charAt(index);
      }
      if (expected.charAt(index) != actual.charAt(index)) {
        String message="String_Node_Str" + getMethodURI() + "String_Node_Str";
        message+="String_Node_Str" + line + "String_Node_Str"+ character+ "String_Node_Str";
        index++;
        while (expected.charAt(index) != '\n' && actual.charAt(index) != '\n' && index < size) {
          expectedLine+=expected.charAt(index);
          actualLine+=actual.charAt(index);
          index++;
        }
        message+="String_Node_Str" + expectedLine + "String_Node_Str";
        message+="String_Node_Str" + actualLine + "String_Node_Str";
        message+=actual;
        throw new AssertionFailedError(message);
      }
      index++;
    }
  }
}