Closed GoogleCodeExporter closed 8 years ago
You remember the boolean hasXX protobuf has, using a wrapper, we can avoid
those extra boolean variables.
This also has the advantage when the message is used on a templating engine
(jsp, velocity, etc) ... there is no extra auto-boxing when reflection is used.
I have been planning to do add code generation without auto-boxing (including
primitive lists) ...
I'll try to add it on the upcoming release.
Original comment by david.yu...@gmail.com
on 7 Feb 2011 at 11:35
Btw those extra protobuf boolean hasXX vars are for the validation checks
(required fields, default value handling)
Original comment by david.yu...@gmail.com
on 7 Feb 2011 at 11:43
I've just added a compiler option: primitive_numbers_if_optional
booleans will still be wrapped (There is no object creation overhead ... its
either Boolean.TRUE or Boolean.FALSE)
@rev 1253.
Original comment by david.yu...@gmail.com
on 13 Feb 2011 at 4:32
Original comment by david.yu...@gmail.com
on 14 Feb 2011 at 12:51
this is great, thanks! How do I tell what build this went into?
Original comment by anthony....@yahoo.co.uk
on 16 Feb 2011 at 12:52
1.0.0
Original comment by david.yu...@gmail.com
on 16 Feb 2011 at 1:33
oh ok, so 1.0.0 is a later version than 1.0.0.M7 ?
Original comment by anthony....@yahoo.co.uk
on 16 Feb 2011 at 1:37
Yes. Btw, you can now use -Dproto_path=$path similar to protoc's --proto_path
arg.
Original comment by david.yu...@gmail.com
on 16 Feb 2011 at 1:43
I just noticed that this only works if the fields are optional... Whats the
reason for that please?
Original comment by anthony....@yahoo.co.uk
on 16 Feb 2011 at 2:39
See the generated schema's method "isInitialized". That's where the wrapper is
needed for required fields.
Original comment by david.yu...@gmail.com
on 16 Feb 2011 at 9:38
Original issue reported on code.google.com by
anthony....@yahoo.co.uk
on 7 Feb 2011 at 11:15