Program: 75242
Project: 75242
Buggy source:
public void testRWLongString(){
  String begin="String_Node_Str";
  StringBuffer buffer=new StringBuffer(begin);
  for (int i=1; i < 65537; i++) {
    buffer.append(i);
  }
  DataOutputStream dos=null;
  DataInputStream dis=null;
  try {
    boolean correct=true;
    final int size=600000;
    byte[] content=null;
    ByteArrayOutputStream bos=new ByteArrayOutputStream(size);
    dos=new DataOutputStream(bos);
    IOUtil.writeString(dos,buffer.toString());
    content=bos.toByteArray();
    ByteArrayInputStream bis=new ByteArrayInputStream(content);
    dis=new DataInputStream(bis);
    String ret=IOUtil.readString(dis);
    StringBuffer buf=new StringBuffer(ret);
    if (buf.length() != buffer.length())     correct=false;
 else {
      for (int i=1; i < buf.length(); i++) {
        if (buffer.charAt(i) != buf.charAt(i)) {
          correct=false;
          break;
        }
      }
    }
    assertTrue("String_Node_Str",correct);
    final int size2=600005;
    bos=new ByteArrayOutputStream(size2);
    dos=new DataOutputStream(bos);
    IOUtil.writeObject(dos,ret);
    content=bos.toByteArray();
    bis=new ByteArrayInputStream(content);
    dis=new DataInputStream(bis);
    Object obj=IOUtil.readObject(dis);
    assertTrue("String_Node_Str",((String)obj).startsWith(begin));
    buf=new StringBuffer((String)obj);
    if (buf.length() != buffer.length())     correct=false;
 else {
      for (int i=1; i < buf.length(); i++) {
        if (buffer.charAt(i) != buf.charAt(i)) {
          correct=false;
          break;
        }
      }
    }
    assertTrue("String_Node_Str",correct);
  }
 catch (  FileNotFoundException e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
  }
catch (  IOException e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void testRWLongString() throws IOException, FileNotFoundException {
  String begin="String_Node_Str";
  StringBuffer buffer=new StringBuffer(begin);
  for (int i=1; i < 65537; i++) {
    buffer.append(i);
  }
  DataOutputStream dos=null;
  DataInputStream dis=null;
  boolean correct=true;
  final int size=600000;
  byte[] content=null;
  ByteArrayOutputStream bos=new ByteArrayOutputStream(size);
  dos=new DataOutputStream(bos);
  IOUtil.writeString(dos,buffer.toString());
  content=bos.toByteArray();
  ByteArrayInputStream bis=new ByteArrayInputStream(content);
  dis=new DataInputStream(bis);
  String ret=IOUtil.readString(dis);
  StringBuffer buf=new StringBuffer(ret);
  if (buf.length() != buffer.length())   correct=false;
 else {
    for (int i=1; i < buf.length(); i++) {
      if (buffer.charAt(i) != buf.charAt(i)) {
        correct=false;
        break;
      }
    }
  }
  assertTrue("String_Node_Str",correct);
  final int size2=600005;
  bos=new ByteArrayOutputStream(size2);
  dos=new DataOutputStream(bos);
  IOUtil.writeObject(dos,ret);
  content=bos.toByteArray();
  bis=new ByteArrayInputStream(content);
  dis=new DataInputStream(bis);
  Object obj=IOUtil.readObject(dis);
  assertTrue("String_Node_Str",((String)obj).startsWith(begin));
  buf=new StringBuffer((String)obj);
  if (buf.length() != buffer.length())   correct=false;
 else {
    for (int i=1; i < buf.length(); i++) {
      if (buffer.charAt(i) != buf.charAt(i)) {
        correct=false;
        break;
      }
    }
  }
  assertTrue("String_Node_Str",correct);
}