[
https://issues.apache.org/jira/browse/AVRO-1997?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15888144#comment-15888144
]
ASF subversion and git services commented on AVRO-1997:
-------------------------------------------------------
Commit bd457af368e4de281607835e196e78800278b94e in avro's branch
refs/heads/branch-1.8 from [~zolyfarkas]
[ https://git-wip-us.apache.org/repos/asf?p=avro.git;h=bd457af ]
AVRO-1997 [java] get/set defaults for fixed.
closes #194.
Signed-off-by: Thiruvalluvan M G <[email protected]>
> Avro Field.defaultVal broken for Fixed fields.
> ----------------------------------------------
>
> Key: AVRO-1997
> URL: https://issues.apache.org/jira/browse/AVRO-1997
> Project: Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.8.1, 1.8.2
> Reporter: Zoltan Farkas
> Assignee: Zoltan Farkas
> Labels: pull-request-available
> Fix For: 1.8.2
>
>
> here is a unit test to reproduce the issue:
> {code}
> package org.apache.avro;
> import java.nio.ByteBuffer;
> import org.junit.Assert;
> import org.junit.Test;
> public class TestFixed {
> @Test
> public void testFixedDefaultValueDrop() {
> Schema md5 = SchemaBuilder.builder().fixed("MD5").size(16);
> Schema frec = SchemaBuilder.builder().record("test")
> .fields().name("hash").type(md5).withDefault(ByteBuffer.wrap(new
> byte[16])).endRecord();
> Schema.Field field = frec.getField("hash");
> Assert.assertNotNull(field.defaultVal());
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)