You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Bryan Duxbury (JIRA)" <ji...@apache.org> on 2010/02/25 02:42:28 UTC
[jira] Commented: (THRIFT-716) Field names can conflict with local
variables in code for unions
[ https://issues.apache.org/jira/browse/THRIFT-716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12838141#action_12838141 ]
Bryan Duxbury commented on THRIFT-716:
--------------------------------------
That would happen, wouldn't it? The solution is just to rename the internal value var to something like __value__. Feel like submitting a patch?
> Field names can conflict with local variables in code for unions
> ----------------------------------------------------------------
>
> Key: THRIFT-716
> URL: https://issues.apache.org/jira/browse/THRIFT-716
> Project: Thrift
> Issue Type: Bug
> Components: Compiler (Java)
> Reporter: Nathan Marz
>
> Try creating a union with the field name "value", and the code won't compile. In writeFields for the generated class, you'll have something like the following:
> <code>
> case VALUE:
> String value = (String)getFieldValue();
> oprot.writeString(value);
> return;
> </code>
> "String value" conflicts with the parameter "Object value".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.