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:
parent
b41508a344
commit
1cf694b63e
|
@ -39,7 +39,7 @@ public class ShardLockObtainFailedException extends Exception {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getMessage() {
|
public String getMessage() {
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(shardId.toString());
|
sb.append(shardId.toString());
|
||||||
sb.append(": ");
|
sb.append(": ");
|
||||||
sb.append(super.getMessage());
|
sb.append(super.getMessage());
|
||||||
|
|
|
@ -263,7 +263,7 @@ public class Nysiis implements StringEncoder {
|
||||||
str = PAT_DT_ETC.matcher(str).replaceFirst("D");
|
str = PAT_DT_ETC.matcher(str).replaceFirst("D");
|
||||||
|
|
||||||
// First character of key = first character of name.
|
// 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));
|
key.append(str.charAt(0));
|
||||||
|
|
||||||
// Transcode remaining characters, incrementing by one character each time
|
// Transcode remaining characters, incrementing by one character each time
|
||||||
|
|
Loading…
Reference in New Issue