Program: 145456
Project: 145456
Buggy source:
@Test public void serializeTest() throws Exception {
  long rqId=78347834L;
  String entityId="String_Node_Str";
  String command="String_Node_Str";
  Change.Value key1=new Change.Value("String_Node_Str",78.9f,DataTypeInfo.FLOAT);
  Change.Value key2=new Change.Value("String_Node_Str","String_Node_Str",DataTypeInfo.CHAR);
  Change.Value[] keys=new Change.Value[]{key1,key2};
  Timestamp date=new Timestamp((new Date()).getTime());
  CompactClob clob=new CompactClob("String_Node_Str");
  CompactBlob blob=new CompactBlob("String_Node_Str".getBytes("String_Node_Str"));
  Point point=gFactory.createPoint(new Coordinate(52,27));
  DataTypeInfo geometryTypeInfo=DataTypeInfo.GEOMETRY.copy();
  Change.Value data1=new Change.Value("String_Node_Str",56,DataTypeInfo.INTEGER);
  Change.Value data2=new Change.Value("String_Node_Str","String_Node_Str",DataTypeInfo.VARCHAR);
  Change.Value data3=new Change.Value("String_Node_Str",true,DataTypeInfo.BOOLEAN);
  Change.Value data4=new Change.Value("String_Node_Str",false,DataTypeInfo.BIT);
  Change.Value data5=new Change.Value("String_Node_Str",date,DataTypeInfo.TIMESTAMP);
  Change.Value data6=new Change.Value("String_Node_Str",clob,DataTypeInfo.CLOB);
  Change.Value data7=new Change.Value("String_Node_Str",blob,DataTypeInfo.BLOB);
  Change.Value data8=new Change.Value("String_Node_Str",point,geometryTypeInfo);
  Change.Value[] data=new Change.Value[]{data1,data2,data3,data4,data5,data6,data7,data8};
  List<Change> changes=new ArrayList<>();
  Insert i=new Insert(entityId);
  i.data=data;
  Update u=new Update(entityId);
  u.data=data;
  u.keys=keys;
  Delete d=new Delete(entityId);
  d.keys=keys;
  Command c=new Command(entityId);
  c.command=command;
  c.parameters=keys;
  changes.add(i);
  changes.add(u);
  changes.add(d);
  changes.add(c);
  CommitRequest rq1=new CommitRequest(rqId,changes);
  ByteArrayOutputStream out=new ByteArrayOutputStream();
  ProtoWriter writer=new ProtoWriter(out);
  PlatypusRequestWriter.write(rq1,writer);
  writer.flush();
  ProtoReader reader=new ProtoReader(new ByteArrayInputStream(out.toByteArray()));
  Request readRq=PlatypusRequestReader.read(reader);
  assertEquals(rq1.getID(),readRq.getID());
  assertEquals(rq1.getType(),readRq.getType());
  assertTrue(readRq instanceof CommitRequest);
  CommitRequest rq2=(CommitRequest)readRq;
  assertNotNull(rq2.getChanges());
  assertEquals(changes.size(),rq2.getChanges().size());
  assertTrue(rq2.getChanges().get(0) instanceof Insert);
  assertTrue(rq2.getChanges().get(1) instanceof Update);
  assertTrue(rq2.getChanges().get(2) instanceof Delete);
  assertTrue(rq2.getChanges().get(3) instanceof Command);
  Insert i1=(Insert)rq2.getChanges().get(0);
  Update u1=(Update)rq2.getChanges().get(1);
  Delete d1=(Delete)rq2.getChanges().get(2);
  Command c1=(Command)rq2.getChanges().get(3);
  assertEquals(i1.entityId,i.entityId);
  assertEquals(u1.entityId,u.entityId);
  assertEquals(d1.entityId,d.entityId);
  assertEquals(c1.entityId,c.entityId);
  assertNull(c1.command);
  assertNotNull(i1.data);
  assertEquals(i1.data.length,i.data.length);
  assertNotNull(u1.data);
  assertEquals(u1.data.length,u.data.length);
  assertNotNull(u1.keys);
  assertEquals(u1.keys.length,u.keys.length);
  assertNotNull(d1.keys);
  assertEquals(d1.keys.length,d.keys.length);
  assertNotNull(c1.parameters);
  assertEquals(c1.parameters.length,c.parameters.length);
  for (int j=0; j < i1.data.length; j++) {
    compareValues(i1.data[j],i.data[j]);
  }
  for (int j=0; j < u1.data.length; j++) {
    compareValues(u1.data[j],u.data[j]);
  }
  for (int j=0; j < u1.keys.length; j++) {
    compareValues(u1.keys[j],u.keys[j]);
  }
  for (int j=0; j < d1.keys.length; j++) {
    compareValues(d1.keys[j],d.keys[j]);
  }
  for (int j=0; j < c1.parameters.length; j++) {
    compareValues(c1.parameters[j],c.parameters[j]);
  }
}

Fixed version (ground truth):
@Test public void serializeTest() throws Exception {
  long rqId=78347834L;
  String entityId="String_Node_Str";
  String command="String_Node_Str";
  ChangeValue key1=new ChangeValue("String_Node_Str",78.9f,DataTypeInfo.FLOAT);
  ChangeValue key2=new ChangeValue("String_Node_Str","String_Node_Str",DataTypeInfo.CHAR);
  ChangeValue[] keys=new ChangeValue[]{key1,key2};
  Timestamp date=new Timestamp((new Date()).getTime());
  CompactClob clob=new CompactClob("String_Node_Str");
  CompactBlob blob=new CompactBlob("String_Node_Str".getBytes("String_Node_Str"));
  Point point=gFactory.createPoint(new Coordinate(52,27));
  DataTypeInfo geometryTypeInfo=DataTypeInfo.GEOMETRY.copy();
  ChangeValue data1=new ChangeValue("String_Node_Str",56,DataTypeInfo.INTEGER);
  ChangeValue data2=new ChangeValue("String_Node_Str","String_Node_Str",DataTypeInfo.VARCHAR);
  ChangeValue data3=new ChangeValue("String_Node_Str",true,DataTypeInfo.BOOLEAN);
  ChangeValue data4=new ChangeValue("String_Node_Str",false,DataTypeInfo.BIT);
  ChangeValue data5=new ChangeValue("String_Node_Str",date,DataTypeInfo.TIMESTAMP);
  ChangeValue data6=new ChangeValue("String_Node_Str",clob,DataTypeInfo.CLOB);
  ChangeValue data7=new ChangeValue("String_Node_Str",blob,DataTypeInfo.BLOB);
  ChangeValue data8=new ChangeValue("String_Node_Str",point,geometryTypeInfo);
  ChangeValue[] data=new ChangeValue[]{data1,data2,data3,data4,data5,data6,data7,data8};
  List<Change> changes=new ArrayList<>();
  Insert i=new Insert(entityId);
  i.data=data;
  Update u=new Update(entityId);
  u.data=data;
  u.keys=keys;
  Delete d=new Delete(entityId);
  d.keys=keys;
  Command c=new Command(entityId);
  c.command=command;
  c.parameters=keys;
  changes.add(i);
  changes.add(u);
  changes.add(d);
  changes.add(c);
  CommitRequest rq1=new CommitRequest(rqId,changes);
  ByteArrayOutputStream out=new ByteArrayOutputStream();
  ProtoWriter writer=new ProtoWriter(out);
  PlatypusRequestWriter.write(rq1,writer);
  writer.flush();
  ProtoReader reader=new ProtoReader(new ByteArrayInputStream(out.toByteArray()));
  Request readRq=PlatypusRequestReader.read(reader);
  assertEquals(rq1.getID(),readRq.getID());
  assertEquals(rq1.getType(),readRq.getType());
  assertTrue(readRq instanceof CommitRequest);
  CommitRequest rq2=(CommitRequest)readRq;
  assertNotNull(rq2.getChanges());
  assertEquals(changes.size(),rq2.getChanges().size());
  assertTrue(rq2.getChanges().get(0) instanceof Insert);
  assertTrue(rq2.getChanges().get(1) instanceof Update);
  assertTrue(rq2.getChanges().get(2) instanceof Delete);
  assertTrue(rq2.getChanges().get(3) instanceof Command);
  Insert i1=(Insert)rq2.getChanges().get(0);
  Update u1=(Update)rq2.getChanges().get(1);
  Delete d1=(Delete)rq2.getChanges().get(2);
  Command c1=(Command)rq2.getChanges().get(3);
  assertEquals(i1.entityId,i.entityId);
  assertEquals(u1.entityId,u.entityId);
  assertEquals(d1.entityId,d.entityId);
  assertEquals(c1.entityId,c.entityId);
  assertNull(c1.command);
  assertNotNull(i1.data);
  assertEquals(i1.data.length,i.data.length);
  assertNotNull(u1.data);
  assertEquals(u1.data.length,u.data.length);
  assertNotNull(u1.keys);
  assertEquals(u1.keys.length,u.keys.length);
  assertNotNull(d1.keys);
  assertEquals(d1.keys.length,d.keys.length);
  assertNotNull(c1.parameters);
  assertEquals(c1.parameters.length,c.parameters.length);
  for (int j=0; j < i1.data.length; j++) {
    compareValues(i1.data[j],i.data[j]);
  }
  for (int j=0; j < u1.data.length; j++) {
    compareValues(u1.data[j],u.data[j]);
  }
  for (int j=0; j < u1.keys.length; j++) {
    compareValues(u1.keys[j],u.keys[j]);
  }
  for (int j=0; j < d1.keys.length; j++) {
    compareValues(d1.keys[j],d.keys[j]);
  }
  for (int j=0; j < c1.parameters.length; j++) {
    compareValues(c1.parameters[j],c.parameters[j]);
  }
}