GithubHelp home page GithubHelp logo

Comments (6)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 26, 2024
Sorry for being so late. I forgot to setup notifications on the issues :/

Original comment by [email protected] on 6 Mar 2010 at 4:58

from protostuff-googlecode-exported.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 26, 2024
This seems to be a problem for other nullable values as well ... not just 
strings.
Plus, the Message.Builder will throw an NPE if the string you set is null.
We could call clearFoo() instead if the string is null.
I've modified the patch (fixnull2.patch)

Let me know what you think.

Thanks.



Original comment by [email protected] on 6 Mar 2010 at 7:15

Attachments:

from protostuff-googlecode-exported.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 26, 2024
You're right that in Protobuf we shouldn't be setting fields to Null, but rather
avoid setting them at all. I submitted this issue a while back, so I no longer
remember if I encountered this problem because of a bug on my part or something 
more
substantial. I would go with your patch.

Original comment by [email protected] on 6 Mar 2010 at 8:11

from protostuff-googlecode-exported.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 26, 2024
Protobuf's native parsing does not have logic for clearing fields upon 
deserialization.
Because of its built-in default-values and required-values support, only fields 
that
are specifically set (null/default values aren't written) are the only ones 
included
on serialization.

In short, protobuf doesn't pass null values around ... 
The logic to explicitly set/clear the values is handled by application code.

Thanks for the report though!  Gave me a lot of thinking to do.


Original comment by [email protected] on 9 Mar 2010 at 3:21

  • Changed state: WontFix

from protostuff-googlecode-exported.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 26, 2024
A clear method will prolly have to be added on the gwt-overlay code to clear a
property so it won't be included on serialization.

See http://code.google.com/p/protostuff/issues/detail?id=7

Original comment by [email protected] on 9 Mar 2010 at 3:28

from protostuff-googlecode-exported.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 26, 2024
Looking back at this issue ... I do think this still need to be addressed since
messages with "null" values are unacceptable.

Also jackson's parser converts int values to String if calling getText()

The fix is strictly allowing only the token: JsonToken.VALUE_STRING.
New patch attached/applied (rev 678)

Original comment by [email protected] on 7 May 2010 at 3:42

  • Changed state: Fixed

Attachments:

from protostuff-googlecode-exported.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.