You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Gabriel Reid (JIRA)" <ji...@apache.org> on 2012/09/07 22:44:07 UTC

[jira] [Created] (AVRO-1149) Add all-args constructor to generated class definitions

Gabriel Reid created AVRO-1149:
----------------------------------

             Summary: Add all-args constructor to generated class definitions
                 Key: AVRO-1149
                 URL: https://issues.apache.org/jira/browse/AVRO-1149
             Project: Avro
          Issue Type: Improvement
          Components: java
            Reporter: Gabriel Reid


Having an all-args constructor (in addition to the default no-args constructor) can make it a lot easier to work with generated Avro classes directly, as it allows setting up the state of the class in one call.

The included builders are useful for this, but the use of the builder can be overly verbose and not very readable when a small number of parameters are involved.

--
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] (AVRO-1149) Add all-args constructor to generated class definitions

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

Gabriel Reid updated AVRO-1149:
-------------------------------

    Attachment: AVRO-1149.patch

Patch to add all-args constructor to generated java files. Passes all unit tests under lang/java.
                
> Add all-args constructor to generated class definitions
> -------------------------------------------------------
>
>                 Key: AVRO-1149
>                 URL: https://issues.apache.org/jira/browse/AVRO-1149
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>            Reporter: Gabriel Reid
>         Attachments: AVRO-1149.patch
>
>
> Having an all-args constructor (in addition to the default no-args constructor) can make it a lot easier to work with generated Avro classes directly, as it allows setting up the state of the class in one call.
> The included builders are useful for this, but the use of the builder can be overly verbose and not very readable when a small number of parameters are involved.

--
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] (AVRO-1149) Add all-args constructor to generated class definitions

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452507#comment-13452507 ] 

Doug Cutting commented on AVRO-1149:
------------------------------------

Using such constructors makes code more fragile.  For example, adding a new field with a default value would require changes that builder-based code would not need to make.  Also, if you change the order of fields of the same type then code that's probably now buggy will continue to compile without warning.  But just because we emit such constructors doesn't mean folks have to use them.

So I'm okay committing this.  Does anyone else have any objections?
                
> Add all-args constructor to generated class definitions
> -------------------------------------------------------
>
>                 Key: AVRO-1149
>                 URL: https://issues.apache.org/jira/browse/AVRO-1149
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>            Reporter: Gabriel Reid
>         Attachments: AVRO-1149.patch
>
>
> Having an all-args constructor (in addition to the default no-args constructor) can make it a lot easier to work with generated Avro classes directly, as it allows setting up the state of the class in one call.
> The included builders are useful for this, but the use of the builder can be overly verbose and not very readable when a small number of parameters are involved.

--
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] [Assigned] (AVRO-1149) Add all-args constructor to generated class definitions

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

Doug Cutting reassigned AVRO-1149:
----------------------------------

    Assignee: Gabriel Reid
    
> Add all-args constructor to generated class definitions
> -------------------------------------------------------
>
>                 Key: AVRO-1149
>                 URL: https://issues.apache.org/jira/browse/AVRO-1149
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>            Reporter: Gabriel Reid
>            Assignee: Gabriel Reid
>         Attachments: AVRO-1149.patch
>
>
> Having an all-args constructor (in addition to the default no-args constructor) can make it a lot easier to work with generated Avro classes directly, as it allows setting up the state of the class in one call.
> The included builders are useful for this, but the use of the builder can be overly verbose and not very readable when a small number of parameters are involved.

--
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] [Resolved] (AVRO-1149) Add all-args constructor to generated class definitions

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

Doug Cutting resolved AVRO-1149.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 1.7.2

I committed this.  Thanks, Gabriel!
                
> Add all-args constructor to generated class definitions
> -------------------------------------------------------
>
>                 Key: AVRO-1149
>                 URL: https://issues.apache.org/jira/browse/AVRO-1149
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>            Reporter: Gabriel Reid
>            Assignee: Gabriel Reid
>             Fix For: 1.7.2
>
>         Attachments: AVRO-1149.patch
>
>
> Having an all-args constructor (in addition to the default no-args constructor) can make it a lot easier to work with generated Avro classes directly, as it allows setting up the state of the class in one call.
> The included builders are useful for this, but the use of the builder can be overly verbose and not very readable when a small number of parameters are involved.

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