Program: 31564
Project: 31564
Buggy source:
@Test public void testAllFieldTypesField() throws JournalException, IOException {
  writeAndReadRecords(factory.writer(AllFieldTypes.class),1000,64 * 1024,new RecordGenerator<AllFieldTypes>(){
    @Override public void assertRecord(    Record value,    int i) throws IOException {
      AllFieldTypes expected=generate(i);
      int col=0;
      String failedMsg="String_Node_Str" + i;
      assertEquals(failedMsg,expected.aBool,value.getBool(col++));
      assertEquals(failedMsg,expected.aString,value.getStr(col++).toString());
      assertEquals(failedMsg,expected.aByte,value.get(col++));
      assertEquals(failedMsg,expected.aShort,value.getShort(col++));
      assertEquals(failedMsg,expected.anInt,value.getInt(col++));
      DirectInputStream binCol=value.getBin(col++);
      byte[] expectedBin=expected.aBinary.array();
      assertEquals(failedMsg,expectedBin.length,binCol.getLength());
      for (int j=0; j < expectedBin.length; j++) {
        assertEquals(failedMsg + "String_Node_Str" + j,expectedBin[j],(byte)binCol.read());
      }
      assertEquals(failedMsg,expected.aLong,value.getLong(col++));
      assertEquals(failedMsg,expected.aDouble,value.getDouble(col),0.0001);
    }
    @Override public AllFieldTypes generate(    int i){
      AllFieldTypes af=new AllFieldTypes();
      byte[] bin=new byte[i];
      for (int j=0; j < i; j++) {
        bin[j]=(byte)(j % 255);
      }
      af.aBinary=ByteBuffer.wrap(bin);
      af.aBool=i % 2 == 0;
      af.aByte=(byte)(i % 255);
      af.aDouble=i * Math.PI;
      af.aLong=i * 2;
      af.anInt=i;
      af.aShort=(short)(i / 2);
      StringBuilder sb=new StringBuilder(i);
      for (int j=0; j < i; j++) {
        sb.append((char)j);
      }
      af.aString=sb.toString();
      return af;
    }
  }
);
}

Fixed version (ground truth):
@Test public void testAllFieldTypesField() throws JournalException, IOException {
  writeAndReadRecords(factory.writer(AllFieldTypes.class),1000,64 * 1024,new RecordGenerator<AllFieldTypes>(){
    @Override public void assertRecord(    Record value,    int i) throws IOException {
      AllFieldTypes expected=generate(i);
      int col=0;
      String failedMsg="String_Node_Str" + i;
      assertEquals(failedMsg,expected.aBool,value.getBool(col++));
      assertEquals(failedMsg,expected.aString,value.getStr(col++).toString());
      assertEquals(failedMsg,expected.aByte,value.get(col++));
      assertEquals(failedMsg,expected.aShort,value.getShort(col++));
      assertEquals(failedMsg,expected.anInt,value.getInt(col++));
      DirectInputStream binCol=value.getBin(col++);
      byte[] expectedBin=expected.aBinary.array();
      assertEquals(failedMsg,expectedBin.length,binCol.getLength());
      for (int j=0; j < expectedBin.length; j++) {
        assertEquals(failedMsg + "String_Node_Str" + j,expectedBin[j],(byte)binCol.read());
      }
      assertEquals(failedMsg,expected.aLong,value.getLong(col++));
      assertEquals(failedMsg,expected.aDouble,value.getDouble(col++),0.0001);
      assertEquals(failedMsg,expected.aFloat,value.getFloat(col),0.0001);
    }
    @Override public AllFieldTypes generate(    int i){
      AllFieldTypes af=new AllFieldTypes();
      byte[] bin=new byte[i];
      for (int j=0; j < i; j++) {
        bin[j]=(byte)(j % 255);
      }
      af.aBinary=ByteBuffer.wrap(bin);
      af.aBool=i % 2 == 0;
      af.aByte=(byte)(i % 255);
      af.aDouble=i * Math.PI;
      af.aFloat=(float)(Math.PI / i);
      af.aLong=i * 2;
      af.anInt=i;
      af.aShort=(short)(i / 2);
      StringBuilder sb=new StringBuilder(i);
      for (int j=0; j < i; j++) {
        sb.append((char)j);
      }
      af.aString=sb.toString();
      return af;
    }
  }
);
}