avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Cutting (Created) (JIRA)" <j...@apache.org>
Subject [jira] [Created] (AVRO-909) change generated getter methods for string fields to return java.lang.String instead of Utf8
Date Wed, 05 Oct 2011 20:54:29 GMT
change generated getter methods for string fields to return java.lang.String instead of Utf8
--------------------------------------------------------------------------------------------

                 Key: AVRO-909
                 URL: https://issues.apache.org/jira/browse/AVRO-909
             Project: Avro
          Issue Type: Sub-task
          Components: java
            Reporter: Doug Cutting
            Assignee: Doug Cutting
             Fix For: 1.6.0


A field X of type string might generate:
{code}
public CharSequence x;                // for back compatibility
public void setX(String s) {
  if (x instanceof Utf8)
    x.set(s);
  else
    x = new Utf8(s);
}
public String getX() { return x.toString(); }
{code}

The accessor methods have not yet been released, so this would be a compatible change in 1.6.
 Applications that wished to use Utf8 directly for performance could still use the field directly.
 Utf8 could be improved to lazily convert between byte[] and String representations.

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

        

Mime
View raw message