Comments (6)
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.
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.
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.
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.
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.
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)
- Would like support for repeated accessors with out "List" appeneded
- Enter one-line summary HOT 2
- getSchema() of java.util.Properties fails HOT 2
- optimize xml format
- Enum alias support
- YamlOutput bug on repeated message fields HOT 1
- Deserializing a message which is protostuff-runtime serialized and has custom class as field HOT 3
- Visual disturbance of @Deprecated annotation HOT 12
- Support for newing object instances on Android 4.3+ devices HOT 2
- ConcurrentLinkedDeque support HOT 1
- Produces uncompilable Java when a field is called "default" HOT 4
- 1.0.7 Build error: ProtoParserTest fails HOT 2
- protostuff-parser and protostuff-compiler disagree on required version of antlr
- Optimize ProtobufOuput for small nested messages (max size of 127) HOT 1
- How can I serialize a negative int32 to the protobuf format using zigzag encoding? HOT 2
- How to Ignore Array of Null Values in JSON
- enums_by_name does not seem to be working using maven plugin
- The value of DataInput.readByte() should not be eof-checked since that method throws EOFException HOT 1
- Wrong output path is generated in Windows for .java files HOT 3
- Unable to parse proto enum containing hex constants HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from protostuff-googlecode-exported.