Program: 7382
Project: 7382
Buggy source:
@Test public void testNestedRecord() throws Exception {
  Schema innerSchema=Schema.recordOf("String_Node_Str",Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.INT)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.DOUBLE)));
  Schema schema=Schema.recordOf("String_Node_Str",Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.INT)),Schema.Field.of("String_Node_Str",innerSchema));
  org.apache.avro.Schema avroInnerSchema=convertSchema(innerSchema);
  org.apache.avro.Schema avroSchema=convertSchema(schema);
  GenericRecord record=new GenericRecordBuilder(avroSchema).set("String_Node_Str",Integer.MAX_VALUE).set("String_Node_Str",new GenericRecordBuilder(avroInnerSchema).set("String_Node_Str",5).set("String_Node_Str",3.14159).build()).build();
  ByteArrayOutputStream out=new ByteArrayOutputStream();
  BinaryEncoder encoder=EncoderFactory.get().binaryEncoder(out,null);
  DatumWriter<GenericRecord> writer=new GenericDatumWriter<GenericRecord>(avroSchema);
  writer.write(record,encoder);
  encoder.flush();
  out.close();
  byte[] serializedRecord=out.toByteArray();
  FormatSpecification formatSpecification=new FormatSpecification(RecordFormats.AVRO,schema,Collections.<String,String>emptyMap());
  AvroRecordFormat format=new AvroRecordFormat();
  format.initialize(formatSpecification);
  GenericRecord actual=format.read(ByteBuffer.wrap(serializedRecord));
  Assert.assertEquals(Integer.MAX_VALUE,actual.get("String_Node_Str"));
  GenericRecord actualInner=(GenericRecord)actual.get("String_Node_Str");
  Assert.assertEquals(5,actualInner.get("String_Node_Str"));
  Assert.assertEquals(3.14159,actualInner.get("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testNestedRecord() throws Exception {
  Schema innerSchema=Schema.recordOf("String_Node_Str",Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.INT)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.DOUBLE)));
  Schema schema=Schema.recordOf("String_Node_Str",Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.INT)),Schema.Field.of("String_Node_Str",innerSchema));
  org.apache.avro.Schema avroInnerSchema=convertSchema(innerSchema);
  org.apache.avro.Schema avroSchema=convertSchema(schema);
  GenericRecord record=new GenericRecordBuilder(avroSchema).set("String_Node_Str",Integer.MAX_VALUE).set("String_Node_Str",new GenericRecordBuilder(avroInnerSchema).set("String_Node_Str",5).set("String_Node_Str",3.14159).build()).build();
  ByteArrayOutputStream out=new ByteArrayOutputStream();
  BinaryEncoder encoder=EncoderFactory.get().binaryEncoder(out,null);
  DatumWriter<GenericRecord> writer=new GenericDatumWriter<GenericRecord>(avroSchema);
  writer.write(record,encoder);
  encoder.flush();
  out.close();
  byte[] serializedRecord=out.toByteArray();
  FormatSpecification formatSpecification=new FormatSpecification(Formats.AVRO,schema,Collections.<String,String>emptyMap());
  RecordFormat<ByteBuffer,GenericRecord> format=RecordFormats.createInitializedFormat(formatSpecification);
  GenericRecord actual=format.read(ByteBuffer.wrap(serializedRecord));
  Assert.assertEquals(Integer.MAX_VALUE,actual.get("String_Node_Str"));
  GenericRecord actualInner=(GenericRecord)actual.get("String_Node_Str");
  Assert.assertEquals(5,actualInner.get("String_Node_Str"));
  Assert.assertEquals(3.14159,actualInner.get("String_Node_Str"));
}