[ 
https://issues.apache.org/jira/browse/THRIFT-1835?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nicolas Trésegnie updated THRIFT-1835:
--------------------------------------

    Description: 
Thrift accept structs with a duplicate field name if the IDs are different. 
However, the generated java code does not compile.

{code}
struct duplicate {
    1: i32 field,
    2: i32 field
}
{code}

{code}
private static final org.apache.thrift.protocol.TField FIELD_FIELD_DESC = ...
private static final org.apache.thrift.protocol.TField FIELD_FIELD_DESC = ...
{code}

  was:
Thrift accept structs with a duplicate field name if the IDs are different. 
However, the generated java code does not compile.
{code}
struct duplicate {
    1: i32 field,
    2: i32 field
}
{code}

{code}
private static final org.apache.thrift.protocol.TField FIELD_FIELD_DESC = ...
private static final org.apache.thrift.protocol.TField FIELD_FIELD_DESC = ...
{code}

    
> Compiler should fail when duplicate field names are present
> -----------------------------------------------------------
>
>                 Key: THRIFT-1835
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1835
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Compiler
>    Affects Versions: 0.9
>            Reporter: Nicolas Trésegnie
>
> Thrift accept structs with a duplicate field name if the IDs are different. 
> However, the generated java code does not compile.
> {code}
> struct duplicate {
>     1: i32 field,
>     2: i32 field
> }
> {code}
> {code}
> private static final org.apache.thrift.protocol.TField FIELD_FIELD_DESC = ...
> private static final org.apache.thrift.protocol.TField FIELD_FIELD_DESC = ...
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to