You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Scott Carey (Created) (JIRA)" <ji...@apache.org> on 2012/01/05 23:57:39 UTC

[jira] [Created] (AVRO-988) Java: Add public, private, and public-deprecated options for SpecificCompiler output

Java:  Add public, private, and public-deprecated options for SpecificCompiler output
-------------------------------------------------------------------------------------

                 Key: AVRO-988
                 URL: https://issues.apache.org/jira/browse/AVRO-988
             Project: Avro
          Issue Type: Improvement
    Affects Versions: 1.6.1
            Reporter: Scott Carey


The specific compiler produces deprecation warnings in both client code and the specific generated classes themselves.  The field visibility should be configurable by the user.  
I propose that the SpecificCompiler for the default template allow for a fieldVisibility option that is one of the below:
* 'public'  fields are public, and not deprecated, this is the 1.5.x behavior
* 'public-deprecated'  fields are public, and marked @Deprecated.  This is the default behavior in 1.6.x
* 'private'  fields are private.  This may be the default in the future.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (AVRO-988) Java: Add public, private, and public-deprecated options for SpecificCompiler output

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

Doug Cutting updated AVRO-988:
------------------------------

    Affects Version/s:     (was: 1.7.3)
                       1.7.2
        Fix Version/s: 1.7.3
             Assignee: Jeff Kolesky

This looks good to me.  I'll commit it soon unless someone objects.
                
> Java:  Add public, private, and public-deprecated options for SpecificCompiler output
> -------------------------------------------------------------------------------------
>
>                 Key: AVRO-988
>                 URL: https://issues.apache.org/jira/browse/AVRO-988
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.2
>            Reporter: Scott Carey
>            Assignee: Jeff Kolesky
>             Fix For: 1.7.3
>
>         Attachments: AVRO-988.patch
>
>
> The specific compiler produces deprecation warnings in both client code and the specific generated classes themselves.  The field visibility should be configurable by the user.  
> I propose that the SpecificCompiler for the default template allow for a fieldVisibility option that is one of the below:
> * 'public'  fields are public, and not deprecated, this is the 1.5.x behavior
> * 'public-deprecated'  fields are public, and marked @Deprecated.  This is the default behavior in 1.6.x
> * 'private'  fields are private.  This may be the default in the future.

--
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-988) Java: Add public, private, and public-deprecated options for SpecificCompiler output

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

Scott Carey updated AVRO-988:
-----------------------------

    Component/s: java
    
> Java:  Add public, private, and public-deprecated options for SpecificCompiler output
> -------------------------------------------------------------------------------------
>
>                 Key: AVRO-988
>                 URL: https://issues.apache.org/jira/browse/AVRO-988
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.6.1
>            Reporter: Scott Carey
>
> The specific compiler produces deprecation warnings in both client code and the specific generated classes themselves.  The field visibility should be configurable by the user.  
> I propose that the SpecificCompiler for the default template allow for a fieldVisibility option that is one of the below:
> * 'public'  fields are public, and not deprecated, this is the 1.5.x behavior
> * 'public-deprecated'  fields are public, and marked @Deprecated.  This is the default behavior in 1.6.x
> * 'private'  fields are private.  This may be the default in the future.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AVRO-988) Java: Add public, private, and public-deprecated options for SpecificCompiler output

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

Scott Carey commented on AVRO-988:
----------------------------------

Overall looks good.  One minor detail:

{code}
  protected SpecificCompiler.FieldVisibility getFieldVisibility() {
    if (this.fieldVisibility == null) {
      return SpecificCompiler.FieldVisibility.PUBLIC_DEPRECATED;
    }
    String visibility = this.fieldVisibility.toUpperCase();
    for (SpecificCompiler.FieldVisibility enumValue : SpecificCompiler.FieldVisibility.values()) {
      if (enumValue.name().equals(visibility)) {
        return enumValue;
      }
    }
    return SpecificCompiler.FieldVisibility.PUBLIC_DEPRECATED;
  }
{code}

Prefer:
{code}
  protected SpecificCompiler.FieldVisibility getFieldVisibility() {
    try {
      String upper = String.valueOf(this.fieldVisibility).trim().toUpperCase();
      return SpecificCompiler.FieldVisibility.valueOf(upper);
    } catch (IllegalArgumentException e) {
      return SpecificCompiler.FieldVisibility.PUBLIC_DEPRECATED;
    }
  }
{code}
                
> Java:  Add public, private, and public-deprecated options for SpecificCompiler output
> -------------------------------------------------------------------------------------
>
>                 Key: AVRO-988
>                 URL: https://issues.apache.org/jira/browse/AVRO-988
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.2
>            Reporter: Scott Carey
>            Assignee: Jeff Kolesky
>             Fix For: 1.7.3
>
>         Attachments: AVRO-988.patch
>
>
> The specific compiler produces deprecation warnings in both client code and the specific generated classes themselves.  The field visibility should be configurable by the user.  
> I propose that the SpecificCompiler for the default template allow for a fieldVisibility option that is one of the below:
> * 'public'  fields are public, and not deprecated, this is the 1.5.x behavior
> * 'public-deprecated'  fields are public, and marked @Deprecated.  This is the default behavior in 1.6.x
> * 'private'  fields are private.  This may be the default in the future.

--
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-988) Java: Add public, private, and public-deprecated options for SpecificCompiler output

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

Jeff Kolesky commented on AVRO-988:
-----------------------------------

I made the change an added it to the larger patch in AVRO-1209.
                
> Java:  Add public, private, and public-deprecated options for SpecificCompiler output
> -------------------------------------------------------------------------------------
>
>                 Key: AVRO-988
>                 URL: https://issues.apache.org/jira/browse/AVRO-988
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.2
>            Reporter: Scott Carey
>            Assignee: Jeff Kolesky
>             Fix For: 1.7.3
>
>         Attachments: AVRO-988.patch
>
>
> The specific compiler produces deprecation warnings in both client code and the specific generated classes themselves.  The field visibility should be configurable by the user.  
> I propose that the SpecificCompiler for the default template allow for a fieldVisibility option that is one of the below:
> * 'public'  fields are public, and not deprecated, this is the 1.5.x behavior
> * 'public-deprecated'  fields are public, and marked @Deprecated.  This is the default behavior in 1.6.x
> * 'private'  fields are private.  This may be the default in the future.

--
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-988) Java: Add public, private, and public-deprecated options for SpecificCompiler output

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

Doug Cutting updated AVRO-988:
------------------------------

    Resolution: Fixed
        Status: Resolved  (was: Patch Available)

I committed this.  Thanks, Jeff!
                
> Java:  Add public, private, and public-deprecated options for SpecificCompiler output
> -------------------------------------------------------------------------------------
>
>                 Key: AVRO-988
>                 URL: https://issues.apache.org/jira/browse/AVRO-988
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.2
>            Reporter: Scott Carey
>            Assignee: Jeff Kolesky
>             Fix For: 1.7.3
>
>         Attachments: AVRO-988.patch
>
>
> The specific compiler produces deprecation warnings in both client code and the specific generated classes themselves.  The field visibility should be configurable by the user.  
> I propose that the SpecificCompiler for the default template allow for a fieldVisibility option that is one of the below:
> * 'public'  fields are public, and not deprecated, this is the 1.5.x behavior
> * 'public-deprecated'  fields are public, and marked @Deprecated.  This is the default behavior in 1.6.x
> * 'private'  fields are private.  This may be the default in the future.

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