You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Jens Geyer (JIRA)" <ji...@apache.org> on 2012/11/29 22:52:59 UTC

[jira] [Created] (THRIFT-1768) unions can't have required fields (Compiler)

Jens Geyer created THRIFT-1768:
----------------------------------

             Summary: unions can't have required fields (Compiler)
                 Key: THRIFT-1768
                 URL: https://issues.apache.org/jira/browse/THRIFT-1768
             Project: Thrift
          Issue Type: Bug
          Components: Delphi - Compiler
    Affects Versions: 0.8, 0.9
            Reporter: Jens Geyer
            Assignee: Jens Geyer
             Fix For: 1.0


Required fields within unions should be treaten as optional, the union construct would not make much sense otherwise. 

--
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

[jira] [Updated] (THRIFT-1768) unions can't have required fields (Compiler)

Posted by "Jens Geyer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1768?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jens Geyer updated THRIFT-1768:
-------------------------------

    Component/s:     (was: Delphi - Compiler)
                 Compiler (General)
    Description: Required fields within unions should issue a warning. First, required makes not much sense qith unions. Next, most languages are already treating them as optional anyway, effectively ignoring the required attribute.  (was: Required fields within unions should be treaten as optional, the union construct would not make much sense otherwise. )
    
> unions can't have required fields (Compiler)
> --------------------------------------------
>
>                 Key: THRIFT-1768
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1768
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (General)
>    Affects Versions: 0.8, 0.9
>            Reporter: Jens Geyer
>            Assignee: Jens Geyer
>             Fix For: 1.0
>
>
> Required fields within unions should issue a warning. First, required makes not much sense qith unions. Next, most languages are already treating them as optional anyway, effectively ignoring the required attribute.

--
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

[jira] [Commented] (THRIFT-1768) unions can't have required fields (Compiler)

Posted by "Jens Geyer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1768?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13508395#comment-13508395 ] 

Jens Geyer commented on THRIFT-1768:
------------------------------------

I'm not sure, but could forcing the required flag to be T_OPTIONAL for members of a union a better way to handle this? The warning should be left there as well, but the modified value would make sure, all languages that lack the extra union check would handle this edge case correctly.

(Thanks to Kenjiro for the idea)
                
> unions can't have required fields (Compiler)
> --------------------------------------------
>
>                 Key: THRIFT-1768
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1768
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (General)
>    Affects Versions: 0.8, 0.9
>            Reporter: Jens Geyer
>            Assignee: Jens Geyer
>             Fix For: 1.0
>
>         Attachments: THRIFT-1768_unions_cant_have_required_fields_Compiler.patch
>
>
> Required fields within unions should issue a warning. First, required makes not much sense with unions. Next, most languages are already treating them as optional anyway, effectively ignoring the required attribute.

--
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

[jira] [Commented] (THRIFT-1768) unions can't have required fields (Compiler)

Posted by "Kenjiro Fukumitsu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1768?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13509770#comment-13509770 ] 

Kenjiro Fukumitsu commented on THRIFT-1768:
-------------------------------------------

I think at the entrance of union's property setter, we should call a function to clear all the values and issets.
                
> unions can't have required fields (Compiler)
> --------------------------------------------
>
>                 Key: THRIFT-1768
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1768
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (General)
>    Affects Versions: 0.8, 0.9
>            Reporter: Jens Geyer
>            Assignee: Jens Geyer
>             Fix For: 1.0
>
>         Attachments: THRIFT-1768_unions_cant_have_required_fields_Compiler.patch
>
>
> Required fields within unions should issue a warning. First, required makes not much sense with unions. Next, most languages are already treating them as optional anyway, effectively ignoring the required attribute.

--
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

[jira] [Updated] (THRIFT-1768) unions can't have required fields (Compiler)

Posted by "Jens Geyer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1768?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jens Geyer updated THRIFT-1768:
-------------------------------

    Attachment: THRIFT-1768_unions_cant_have_required_fields_Compiler - rev1.patch

Revised patch:
 * warning for required fields in unions
 * required field in unions are now forced to be optional
 * more than one default value within a union throws an error.

I'm not sure about the Defaults anyway. I can't see an argument against having a default, except that Java as the reference implementation completely ignores them (without a warning, by the way)
                
> unions can't have required fields (Compiler)
> --------------------------------------------
>
>                 Key: THRIFT-1768
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1768
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (General)
>    Affects Versions: 0.8, 0.9
>            Reporter: Jens Geyer
>            Assignee: Jens Geyer
>             Fix For: 1.0
>
>         Attachments: THRIFT-1768_unions_cant_have_required_fields_Compiler - rev1.patch
>
>
> Required fields within unions should issue a warning. First, required makes not much sense with unions. Next, most languages are already treating them as optional anyway, effectively ignoring the required attribute.

--
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

[jira] [Updated] (THRIFT-1768) unions can't have required fields (Compiler)

Posted by "Jens Geyer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1768?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jens Geyer updated THRIFT-1768:
-------------------------------

    Attachment:     (was: THRIFT-1768_unions_cant_have_required_fields_Compiler.patch)
    
> unions can't have required fields (Compiler)
> --------------------------------------------
>
>                 Key: THRIFT-1768
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1768
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (General)
>    Affects Versions: 0.8, 0.9
>            Reporter: Jens Geyer
>            Assignee: Jens Geyer
>             Fix For: 1.0
>
>
> Required fields within unions should issue a warning. First, required makes not much sense with unions. Next, most languages are already treating them as optional anyway, effectively ignoring the required attribute.

--
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

[jira] [Updated] (THRIFT-1768) unions can't have required fields (Compiler)

Posted by "Jens Geyer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1768?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jens Geyer updated THRIFT-1768:
-------------------------------

    Attachment: THRIFT-1768_unions_cant_have_required_fields_Compiler.patch
    
> unions can't have required fields (Compiler)
> --------------------------------------------
>
>                 Key: THRIFT-1768
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1768
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (General)
>    Affects Versions: 0.8, 0.9
>            Reporter: Jens Geyer
>            Assignee: Jens Geyer
>             Fix For: 1.0
>
>         Attachments: THRIFT-1768_unions_cant_have_required_fields_Compiler.patch
>
>
> Required fields within unions should issue a warning. First, required makes not much sense qith unions. Next, most languages are already treating them as optional anyway, effectively ignoring the required attribute.

--
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

[jira] [Updated] (THRIFT-1768) unions can't have required fields (Compiler)

Posted by "Jens Geyer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1768?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jens Geyer updated THRIFT-1768:
-------------------------------

    Description: Required fields within unions should issue a warning. First, required makes not much sense with unions. Next, most languages are already treating them as optional anyway, effectively ignoring the required attribute.  (was: Required fields within unions should issue a warning. First, required makes not much sense qith unions. Next, most languages are already treating them as optional anyway, effectively ignoring the required attribute.)
    
> unions can't have required fields (Compiler)
> --------------------------------------------
>
>                 Key: THRIFT-1768
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1768
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (General)
>    Affects Versions: 0.8, 0.9
>            Reporter: Jens Geyer
>            Assignee: Jens Geyer
>             Fix For: 1.0
>
>         Attachments: THRIFT-1768_unions_cant_have_required_fields_Compiler.patch
>
>
> Required fields within unions should issue a warning. First, required makes not much sense with unions. Next, most languages are already treating them as optional anyway, effectively ignoring the required attribute.

--
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