Re: Builder set* methods should be aware of null values

2009-04-02 Thread Kenton Varda
As Jerry said, see issue 57: http://code.google.com/p/protobuf/issues/detail?id=57 Summary: This is fixed in SVN by making setters themselves throw NPE if the input is null. Some people think this is the wrong behavior, and that setting a value to null should instead be equivalent to clearing it

Re: Builder set* methods should be aware of null values

2009-04-02 Thread Jerry Cattell
See discussion here: http://code.google.com/p/protobuf/issues/detail?id=57 On Apr 1, 5:03 pm, Jim Sermersheim wrote: > In the generated Java code, a typical Builder set method might look like > this: >       public Builder setSomething(java.lang.String value) { >         result.hasSomething = tr

Builder set* methods should be aware of null values

2009-04-01 Thread Jim Sermersheim
In the generated Java code, a typical Builder set method might look like this: public Builder setSomething(java.lang.String value) { result.hasSomething = true; result.something_ = value; return this; } Later, when we build the message and then serialize it,