avro-dev mailing list archives

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

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

Gabor Szadovszky updated AVRO-2054:
-----------------------------------
       Resolution: Fixed
    Fix Version/s: 1.9.0
           Status: Resolved  (was: Patch Available)

> 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
>            Assignee: BELUGA BEHR
>            Priority: Trivial
>             Fix For: 1.9.0
>
>         Attachments: AVRO-2054.1.patch, AVRO-2054.2.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