Remove use of StringBuffer 40/82640/1
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 21 Jun 2019 05:36:01 +0000 (07:36 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 21 Jun 2019 05:36:01 +0000 (07:36 +0200)
StringBuilder is a faster replacement, use that instead of
StringBuffer.

Change-Id: I5baafddeefff469796cd33dea7056cc0d6a5f6c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/TransactInvokerImpl.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TransactUtils.java

index ae77d46689d1dc18b95b125c34adb68722ab0e49..f4c0f0d586087fa555287473e9f01db5a07a6446 100644 (file)
@@ -69,7 +69,7 @@ public class TransactInvokerImpl implements TransactInvoker {
     }
 
     void printError(TransactionBuilder tb) {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         for (Operation op : tb.getOperations()) {
             if (op instanceof Insert) {
                 Insert insert = (Insert)op;
@@ -94,7 +94,7 @@ public class TransactInvokerImpl implements TransactInvoker {
                         sb.append(entry.getKey()).append(" : ").append(entry.getValue()).append(" , ");
                     }
                 }
-                sb.append("]");
+                sb.append(']');
             }
         }
         LOG.error("Failed transaction {}", sb);
index 243e6ec59b7ccf407201c8c671e22ad366f972f2..5df374f53508c78596526b9ec63e448b93008b5b 100644 (file)
@@ -474,12 +474,12 @@ public class TransactUtils {
             return "";
         }
 
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         for (byte b : bytes) {
             short u8byte = (short) (b & 0xff);
             String tmp = Integer.toHexString(u8byte);
             if (tmp.length() == 1) {
-                buf.append("0");
+                buf.append('0');
             }
             buf.append(tmp);
         }