-
-
Notifications
You must be signed in to change notification settings - Fork 228
Fix for #162 (XML Empty tag to Empty string) #218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Any updates on this? |
Hello everyone ! Is this pull request going to be merged soon? thank you |
return null; | ||
} | ||
|
||
StringBuilder text = new StringBuilder(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmh. Why? This was an optimization for the common case of just single segment, in which case construction of intermediate StringBuilder
was avoided. It's probably not a big deal either way, but usually I prefer not fixing things that ain't broke.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. Actually, I see. So, this was to get empty String over null
.
I think I'll modify this bit differently, after first merging,.
Ok, I am really torn here. The challenge here is this: fix changes low-level behavior, regardless of what target type might be. This means that it could change handling of empty/null cases for any number of other scalar types; here we'd prefer only changing Still.. I think I'm ok for trying this out for 2.9.0, and see if it works better than before. I may be sorry (I've had a few similar-looking cases that burnt :) )... but we'll see. |
Ended up implementing #245 and #246 that should help here: so, by default empty element (but NOT start+end with no content) will be exposed as |
It would be nice to also have a way to make start+end with no content deserialize to |
@mliberty these combinations are bit of a mess. But I didn't think start+end did deserialize to I am now bit torn as to whether to also add matching feature for START+END; but that should go in 3.0. Also, there seem to be (at least?) 3 distinct possibilities for both:
all of which make sense for some use cases. Although due to wide variety of coercions available, perhaps (3) is not needed: it is bit trickier to support (need to emit 2 tokens; will confuse functionality at databind level). |
Unfortunately with 2.x there is no way to make all cases work well: it would be easy enough to induce 3.0.0 will now implement this, however, as suggested. |
Fix for issue #162.