avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "BELUGA BEHR (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AVRO-2054) Use StringBuilder instead of StringBuffer
Date Tue, 18 Jul 2017 19:07:00 GMT

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

BELUGA BEHR updated AVRO-2054:
------------------------------
    Attachment: AVRO-2054.1.patch

> Use StringBuilder instead of StringBuffer
> -----------------------------------------
>
>                 Key: AVRO-2054
>                 URL: https://issues.apache.org/jira/browse/AVRO-2054
>             Project: Avro
>          Issue Type: Improvement
>    Affects Versions: 1.7.7, 1.8.2
>            Reporter: BELUGA BEHR
>            Priority: Trivial
>         Attachments: AVRO-2054.1.patch
>
>
> Use the un-synchronized StringBuilder instead of StringBuffer.  Use _char_ values instead
of Strings.
> {code:title=org.apache.trevni.MetaData}
>   @Override public String toString() {
>     StringBuffer buffer = new StringBuffer();
>     buffer.append("{ ");
>     for (Map.Entry<String,byte[]> e : entrySet()) {
>       buffer.append(e.getKey());
>       buffer.append("=");
>       try {
>         buffer.append(new String(e.getValue(), "ISO-8859-1"));
>       } catch (java.io.UnsupportedEncodingException error) {
>         throw new TrevniRuntimeException(error);
>       }
>       buffer.append(" ");
>     }
>     buffer.append("}");
>     return buffer.toString();
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message