[
https://issues.apache.org/jira/browse/THRIFT-2513?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14131234#comment-14131234
]
Jens Geyer edited comment on THRIFT-2513 at 9/12/14 7:56 AM:
-------------------------------------------------------------
Damn :-) The issue is, that the enums are added without the namespace to the
map<> via {{add_constant()}}. This leads to the "same" (not really) enum value
being added twice, hence the error:
{code}
// pseudocode, call sequence before my last patch
add_constant("One");
add_constant("Foo.One");
add_constant("One");
add_constant("Bar.One");
{code}
So the solution is not to remove the {{add_constant()}} call as I did, but
instead modify the within {{add_constant()}} in order to silently ignore
duplicates. Would that cover all possible cases? What do you think?
was (Author: jensg):
Damn :-) The issue is, that the enums are added without the namespace to the
map<> via {{add_constant()}}. This leads to the "same" (not really) enum value
being added twice, hence the error:
{code}
// pseudocode, call sequence before my last patch
add_constant("One");
add_constant("Foo.One");
add_constant("One");
add_constant("Bar.One");
{code}
So the solution is not to remove the first add_constant() call as I did, but
instead add a check to {{add_constant()}} in order to silently ignore
duplicates. Would that cover all possible cases? What do you think?
> clean up enum value assignment
> ------------------------------
>
> Key: THRIFT-2513
> URL: https://issues.apache.org/jira/browse/THRIFT-2513
> Project: Thrift
> Issue Type: Sub-task
> Components: Build Process, C++ - Compiler, C++ - Library, Test Suite
> Reporter: Roger Meier
> Assignee: Jens Geyer
> Fix For: 0.9.2
>
> Attachments: THRIFT-2513-clean-up-enum-value-assignment.patch,
> pure_enums.patch
>
>
> ticket for pull request 88
> https://github.com/apache/thrift/pull/88
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)