Use StringBuilder in favor of StringBuffer

This removes all instances of StringBuffer that are removeable.

Uncontended synchronization in Java is pretty cheap, but it's unnecessary.
This commit is contained in:
Chris Earle 2016-08-17 17:36:46 -04:00
parent b41508a344
commit 1cf694b63e
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ public class ShardLockObtainFailedException extends Exception {
@Override
public String getMessage() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(shardId.toString());
sb.append(": ");
sb.append(super.getMessage());

View File

@ -263,7 +263,7 @@ public class Nysiis implements StringEncoder {
str = PAT_DT_ETC.matcher(str).replaceFirst("D");
// First character of key = first character of name.
StringBuffer key = new StringBuffer(str.length());
StringBuilder key = new StringBuilder(str.length());
key.append(str.charAt(0));
// Transcode remaining characters, incrementing by one character each time