[ 
https://issues.apache.org/jira/browse/THRIFT-2232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13961980#comment-13961980
 ] 

Ben Sigelman commented on THRIFT-2232:
--------------------------------------

Hi [~apesternikov],
A few responses:

- Sorry about https://issues.apache.org/jira/browse/THRIFT-2451 ... I will 
chime in on that over there, though.
- As for your last point, though, I disagree (as you might imagine!). 
Basically, it's not the job of the serialization library to decide which values 
are "empty". And just because something happens to take on its default value, 
we don't necessarily know that it's "empty"/absent.

I would also suggest looking at the approach that protobufs took to Go... they 
were confronted with much the same set of constraints and ended up with 
something much like what Thrift-2232 yielded.

Anyway, the old code was definitely way more compact. It just wasn't correct in 
the general case :) And that is, unfortunately, a requirement.

> IsSet* broken in Go
> -------------------
>
>                 Key: THRIFT-2232
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2232
>             Project: Thrift
>          Issue Type: Bug
>          Components: Go - Compiler
>            Reporter: Ben Sigelman
>            Assignee: Jens Geyer
>              Labels: isset
>             Fix For: 0.9.2
>
>         Attachments: THRIFT-2322_optional_set_assignment_issue.patch, 
> THRIFT-2322_regenerated_serializer_testfile.patch, 
> thrift-2232-golang-optional-fields-fix.patch
>
>
> The various generated IsSetXYZ() methods just check for magic values of their 
> respective fields. This is obviously broken, and also diverges from the 
> implementation in other languages.
> I am willing and able to fix this myself, but I don't want to start on any 
> impl until we can decide on an approach.
> At this point, though, optional fields in Go are basically useless if one's 
> application makes use of the magic "absence" value.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to