Open GoogleCodeExporter opened 9 years ago
This code sets all fields with default value set, to the default value: Maybe
you could loop on this instead of getFields() on the Message, because that
doesn't return unset field, not even fields with default value set:
for(Descriptors.FieldDescriptor desc : builder.getDescriptorForType().getFields()) {
if(desc.hasDefaultValue()) {
builder.setField(desc, desc.getDefaultValue());
}
}
Original comment by storsv...@comoyo.com
on 25 Oct 2012 at 9:18
Original issue reported on code.google.com by
storsv...@comoyo.com
on 25 Oct 2012 at 2:57