Skip to content

Commit

Permalink
Replace remaining StringBuffer uses with StringBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-hoffman committed Jul 16, 2021
1 parent b4279f6 commit 0827c53
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/main/javassist/bytecode/SignatureAttribute.java
Expand Up @@ -230,7 +230,7 @@ public TypeParameter[] getParameters() {
*/
@Override
public String toString() {
StringBuffer sbuf = new StringBuffer();
StringBuilder sbuf = new StringBuilder();

TypeParameter.toString(sbuf, params);
sbuf.append(" extends ").append(superClass);
Expand All @@ -246,7 +246,7 @@ public String toString() {
* Returns the encoded string representing the method type signature.
*/
public String encode() {
StringBuffer sbuf = new StringBuffer();
StringBuilder sbuf = new StringBuilder();
if (params.length > 0) {
sbuf.append('<');
for (int i = 0; i < params.length; i++)
Expand Down Expand Up @@ -320,7 +320,7 @@ public MethodSignature(TypeParameter[] tp, Type[] params, Type ret, ObjectType[]
*/
@Override
public String toString() {
StringBuffer sbuf = new StringBuffer();
StringBuilder sbuf = new StringBuilder();

TypeParameter.toString(sbuf, typeParams);
sbuf.append(" (");
Expand All @@ -339,7 +339,7 @@ public String toString() {
* Returns the encoded string representing the method type signature.
*/
public String encode() {
StringBuffer sbuf = new StringBuffer();
StringBuilder sbuf = new StringBuilder();
if (typeParams.length > 0) {
sbuf.append('<');
for (int i = 0; i < typeParams.length; i++)
Expand Down Expand Up @@ -450,7 +450,7 @@ public String toString() {
return sbuf.toString();
}

static void toString(StringBuffer sbuf, TypeParameter[] tp) {
static void toString(StringBuilder sbuf, TypeParameter[] tp) {
sbuf.append('<');
for (int i = 0; i < tp.length; i++) {
if (i > 0)
Expand All @@ -462,7 +462,7 @@ static void toString(StringBuffer sbuf, TypeParameter[] tp) {
sbuf.append('>');
}

void encode(StringBuffer sb) {
void encode(StringBuilder sb) {
sb.append(name);
if (superClass == null)
sb.append(":Ljava/lang/Object;");
Expand Down Expand Up @@ -570,7 +570,7 @@ else if (wildcard == '+')
return "? super " + type;
}

static void encode(StringBuffer sb, TypeArgument[] args) {
static void encode(StringBuilder sb, TypeArgument[] args) {
sb.append('<');
for (int i = 0; i < args.length; i++) {
TypeArgument ta = args[i];
Expand All @@ -589,8 +589,8 @@ static void encode(StringBuffer sb, TypeArgument[] args) {
* Primitive types and object types.
*/
public static abstract class Type {
abstract void encode(StringBuffer sb);
static void toString(StringBuffer sbuf, Type[] ts) {
abstract void encode(StringBuilder sb);
static void toString(StringBuilder sbuf, Type[] ts) {
for (int i = 0; i < ts.length; i++) {
if (i > 0)
sbuf.append(", ");
Expand Down Expand Up @@ -647,7 +647,7 @@ public String toString() {
}

@Override
void encode(StringBuffer sb) {
void encode(StringBuilder sb) {
sb.append(descriptor);
}
}
Expand All @@ -661,7 +661,7 @@ public static abstract class ObjectType extends Type {
* Returns the encoded string representing the object type signature.
*/
public String encode() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
encode(sb);
return sb.toString();
}
Expand Down Expand Up @@ -782,13 +782,13 @@ public String jvmTypeName() {
}

@Override
void encode(StringBuffer sb) {
void encode(StringBuilder sb) {
sb.append('L');
encode2(sb);
sb.append(';');
}

void encode2(StringBuffer sb) {
void encode2(StringBuilder sb) {
ClassType parent = getDeclaringClass();
if (parent != null) {
parent.encode2(sb);
Expand Down Expand Up @@ -876,7 +876,7 @@ public String toString() {
}

@Override
void encode(StringBuffer sb) {
void encode(StringBuilder sb) {
for (int i = 0; i < dim; i++)
sb.append('[');

Expand Down Expand Up @@ -919,7 +919,7 @@ public String toString() {
}

@Override
void encode(StringBuffer sb) {
void encode(StringBuilder sb) {
sb.append('T').append(name).append(';');
}
}
Expand Down

0 comments on commit 0827c53

Please sign in to comment.