Program: 24240
Project: 24240
Buggy source:
@Test public void testPreparedThenAbort() throws Exception {
  String path=Paths.get(String.format("String_Node_Str",Paths.get("String_Node_Str").toAbsolutePath().toString(),SCRIPT_PATH,"String_Node_Str")).toString();
  Socket client=new Socket();
  client.connect(new InetSocketAddress("String_Node_Str",61234));
  OutputStream outputStream=client.getOutputStream();
  InputStream inputStream=client.getInputStream();
  byte[] prepare=("String_Node_Str" + "String_Node_Str" + ("String_Node_Str".length() + path.length() + "String_Node_Str".length()) + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ path+ "String_Node_Str").getBytes("String_Node_Str");
  outputStream.write(prepare);
  outputStream.flush();
  String preparedContent="String_Node_Str" + path + "String_Node_Str";
  ByteBuffer preparedExpected=ByteBuffer.wrap(("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + preparedContent.length() + "String_Node_Str"+ "String_Node_Str"+ preparedContent).getBytes("String_Node_Str"));
  ByteBuffer prepared=ByteBuffer.allocate(preparedExpected.capacity());
  while (prepared.hasRemaining()) {
    prepared.put((byte)inputStream.read());
  }
  prepared.flip();
  assertEquals(preparedExpected,prepared);
  byte[] abort=("String_Node_Str" + "String_Node_Str" + ("String_Node_Str".length() + path.length() + "String_Node_Str".length()) + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ path+ "String_Node_Str").getBytes("String_Node_Str");
  outputStream.write(abort);
  outputStream.flush();
  String finishedContent="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + path + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ByteBuffer finishedExpected=ByteBuffer.wrap(("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + finishedContent.length() + "String_Node_Str"+ "String_Node_Str"+ finishedContent).getBytes("String_Node_Str"));
  ByteBuffer finished=ByteBuffer.allocate(finishedExpected.capacity());
  while (finished.hasRemaining()) {
    finished.put((byte)inputStream.read());
  }
  finished.flip();
  client.close();
  assertEquals(finishedExpected,finished);
}

Fixed version (ground truth):
@Test(timeout=TEST_TIMEOUT) public void testPreparedThenAbort() throws Exception {
  String path=Paths.get(String.format("String_Node_Str",Paths.get("String_Node_Str").toAbsolutePath().toString(),SCRIPT_PATH,"String_Node_Str")).toString();
  Socket client=new Socket();
  client.connect(new InetSocketAddress("String_Node_Str",61234));
  OutputStream outputStream=client.getOutputStream();
  InputStream inputStream=client.getInputStream();
  byte[] prepare=("String_Node_Str" + "String_Node_Str" + ("String_Node_Str".length() + path.length()) + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ path+ "String_Node_Str").getBytes("String_Node_Str");
  outputStream.write(prepare);
  outputStream.flush();
  String preparedContent="String_Node_Str" + path + "String_Node_Str";
  ByteBuffer preparedExpected=ByteBuffer.wrap(("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + preparedContent.length() + "String_Node_Str"+ "String_Node_Str"+ preparedContent).getBytes("String_Node_Str"));
  ByteBuffer prepared=ByteBuffer.allocate(preparedExpected.capacity());
  while (prepared.hasRemaining()) {
    prepared.put((byte)inputStream.read());
  }
  prepared.flip();
  assertEquals(preparedExpected,prepared);
  byte[] abort=("String_Node_Str" + "String_Node_Str" + ("String_Node_Str".length() + path.length()) + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ path+ "String_Node_Str").getBytes("String_Node_Str");
  outputStream.write(abort);
  outputStream.flush();
  String finishedContent="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + path + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ByteBuffer finishedExpected=ByteBuffer.wrap(("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + finishedContent.length() + "String_Node_Str"+ "String_Node_Str"+ finishedContent).getBytes("String_Node_Str"));
  ByteBuffer finished=ByteBuffer.allocate(finishedExpected.capacity());
  while (finished.hasRemaining()) {
    finished.put((byte)inputStream.read());
  }
  finished.flip();
  client.close();
  assertEquals(finishedExpected,finished);
}