StringBuilder is a faster replacement, use that instead of
StringBuffer.
Change-Id: I5baafddeefff469796cd33dea7056cc0d6a5f6c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
}
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;
sb.append(entry.getKey()).append(" : ").append(entry.getValue()).append(" , ");
}
}
- sb.append("]");
+ sb.append(']');
}
}
LOG.error("Failed transaction {}", sb);
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);
}