seasonouc / protostuff

Automatically exported from code.google.com/p/protostuff
Apache License 2.0
0 stars 0 forks source link

Boolean default value does not work #126

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
  Set a default value (false) on required bool field

What is the expected output? What do you see instead?
  Default value(false) do not set on bool field

What version of the product are you using? On what operating system?
1.0.5 1.0.7

Original issue reported on code.google.com by spitfi...@gmail.com on 27 Jun 2012 at 9:35

GoogleCodeExporter commented 8 years ago
I might be wrong but according to my experience with protostuff required fields 
can't have default values at all and i believe this goes for protobuf in 
general.

the protobuf guide only describes default values for optional properties.

Original comment by baetz.al...@googlemail.com on 5 Jul 2012 at 10:09

GoogleCodeExporter commented 8 years ago
Yep, baetz is right.  Default values only apply to optional fields.
Protostuff has the same behavior as protobuf.

Original comment by david.yu...@gmail.com on 5 Jul 2012 at 1:09