Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-2054

Use StringBuilder instead of StringBuffer

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 1.7.7, 1.8.2
    • 1.9.0
    • None
    • None
    • Patch

    Description

      Use the un-synchronized StringBuilder instead of StringBuffer. Use char values instead of Strings.

      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();
        }
      

      Attachments

        1. AVRO-2054.2.patch
          1 kB
          David Mollitor
        2. AVRO-2054.1.patch
          1 kB
          David Mollitor

        Activity

          People

            belugabehr David Mollitor
            belugabehr David Mollitor
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: