diff options
author | Andrey Turbanov <turbanoff@gmail.com> | 2021-11-20 17:16:22 +0300 |
---|---|---|
committer | Andrey Turbanov <turbanoff@gmail.com> | 2021-11-20 17:22:06 +0300 |
commit | b1c52e2f5eb624037b8c799c20fbd1b4fd611d9a (patch) | |
tree | 33d7b6e8f733f20514f46e7871b29e26de47913d /org.aspectj.matcher | |
parent | 0f85ca109b9e6ab849e201e76f62d5023cbfcb98 (diff) | |
download | aspectj-b1c52e2f5eb624037b8c799c20fbd1b4fd611d9a.tar.gz aspectj-b1c52e2f5eb624037b8c799c20fbd1b4fd611d9a.zip |
Replace uses of StringBuffer with StringBuilder.
StringBuffer is a legacy synchronized class. StringBuilder is a direct replacement to StringBuffer which generally have better performance.
Diffstat (limited to 'org.aspectj.matcher')
57 files changed, 102 insertions, 102 deletions
diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/AbstractAnnotationAJ.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/AbstractAnnotationAJ.java index a4d47ecc6..648a6aa76 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/AbstractAnnotationAJ.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/AbstractAnnotationAJ.java @@ -95,7 +95,7 @@ public abstract class AbstractAnnotationAJ implements AnnotationAJ { * {@inheritDoc} */ public final String getValidTargets() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append("{"); for (Iterator<String> iter = supportedTargets.iterator(); iter.hasNext();) { String evalue = iter.next(); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Advice.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Advice.java index cc9d3112d..284786213 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Advice.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Advice.java @@ -429,7 +429,7 @@ public abstract class Advice extends ShadowMunger { @Override public String toString() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append("(").append(getKind()).append(extraParametersToString()); sb.append(": ").append(pointcut).append("->").append(signature).append(")"); return sb.toString(); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/AjcMemberMaker.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/AjcMemberMaker.java index 01809e1ec..b20d0c2ca 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/AjcMemberMaker.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/AjcMemberMaker.java @@ -255,7 +255,7 @@ public class AjcMemberMaker { } else { args = new UnresolvedType[] { fieldDeclaringType }; } - StringBuffer name = new StringBuffer("ajc$get$"); + StringBuilder name = new StringBuilder("ajc$get$"); name.append(field.getName()); return new ResolvedMemberImpl(Member.METHOD, fieldDeclaringType, PUBLIC_STATIC, field.getReturnType(), name.toString(), args); @@ -289,7 +289,7 @@ public class AjcMemberMaker { } else { args = new UnresolvedType[] { fieldDeclaringType, field.getType() }; } - StringBuffer name = new StringBuffer("ajc$set$"); + StringBuilder name = new StringBuilder("ajc$set$"); name.append(field.getName()); return new ResolvedMemberImpl(Member.METHOD, fieldDeclaringType, PUBLIC_STATIC, UnresolvedType.VOID, name.toString(), args); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/AnnotationNameValuePair.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/AnnotationNameValuePair.java index 081989330..80453b1b4 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/AnnotationNameValuePair.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/AnnotationNameValuePair.java @@ -31,13 +31,13 @@ public class AnnotationNameValuePair { } public String toString() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append(name + "=" + val.toString()); return sb.toString(); } public String stringify() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); if (!name.equals("value")) { sb.append(name + "="); } diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ArrayAnnotationValue.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ArrayAnnotationValue.java index 7c674b361..ba2ed7c83 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ArrayAnnotationValue.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ArrayAnnotationValue.java @@ -33,7 +33,7 @@ public class ArrayAnnotationValue extends AnnotationValue { } public String stringify() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append("["); for (int i = 0; i < values.length; i++) { sb.append(values[i].stringify()); @@ -45,7 +45,7 @@ public class ArrayAnnotationValue extends AnnotationValue { } public String toString() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append("{"); for (int i = 0; i < values.length; i++) { sb.append(values[i].toString()); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Checker.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Checker.java index 6acb432a7..ea3abd8a8 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Checker.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Checker.java @@ -192,7 +192,7 @@ public class Checker extends ShadowMunger { return msg; } } - StringBuffer ret = new StringBuffer(); + StringBuilder ret = new StringBuilder(); while (curlyIndex >= 0) { if (curlyIndex > 0) { ret.append(msg.substring(pos, curlyIndex).replace("\\{", "{")); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/IntMap.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/IntMap.java index 067d0937a..f6d08c3d8 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/IntMap.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/IntMap.java @@ -130,7 +130,7 @@ public class IntMap { // ---- from object public String toString() { - StringBuffer buf = new StringBuffer("["); + StringBuilder buf = new StringBuilder("["); boolean seenFirst = false; for (int i = 0, len = map.length; i < len; i++) { if (map[i] != MISSING) { diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/JoinPointSignature.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/JoinPointSignature.java index e058bb2ca..b25727498 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/JoinPointSignature.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/JoinPointSignature.java @@ -291,7 +291,7 @@ public class JoinPointSignature implements ResolvedMember { @Override public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(getReturnType().getName()); buf.append(' '); buf.append(getDeclaringType().getName()); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/MemberImpl.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/MemberImpl.java index f5f8cc96b..33111fc65 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/MemberImpl.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/MemberImpl.java @@ -125,7 +125,7 @@ public class MemberImpl implements Member { * just deals with the parameter types. */ public static String typesToSignature(UnresolvedType[] paramTypes) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("("); for (UnresolvedType paramType : paramTypes) { buf.append(paramType.getSignature()); @@ -316,7 +316,7 @@ public class MemberImpl implements Member { @Override public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(returnType.getName()); buf.append(' '); if (declaringType == null) { diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/NameMangler.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/NameMangler.java index 55be28a0d..5975d74b9 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/NameMangler.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/NameMangler.java @@ -327,13 +327,13 @@ public class NameMangler { } public static String aroundShadowMethodName(Member shadowSig, String suffixTag) { - StringBuffer ret = new StringBuffer(); + StringBuilder ret = new StringBuilder(); ret.append(getExtractableName(shadowSig)).append("_aroundBody").append(suffixTag); return ret.toString(); } public static String aroundAdviceMethodName(Member shadowSig, String suffixTag) { - StringBuffer ret = new StringBuffer(); + StringBuilder ret = new StringBuilder(); ret.append(getExtractableName(shadowSig)).append("_aroundBody").append(suffixTag).append("$advice"); return ret.toString(); } diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ReferenceType.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ReferenceType.java index 7dd98234b..022d8242f 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ReferenceType.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ReferenceType.java @@ -1127,7 +1127,7 @@ public class ReferenceType extends ResolvedType { private static String makeParameterizedSignature(ResolvedType aGenericType, ResolvedType[] someParameters) { String rawSignature = aGenericType.getErasureSignature(); - StringBuffer ret = new StringBuffer(); + StringBuilder ret = new StringBuilder(); ret.append(PARAMETERIZED_TYPE_IDENTIFIER); ret.append(rawSignature.substring(1, rawSignature.length() - 1)); ret.append("<"); @@ -1140,7 +1140,7 @@ public class ReferenceType extends ResolvedType { private static String makeDeclaredSignature(ResolvedType aGenericType, UnresolvedType[] someParameters) { - StringBuffer ret = new StringBuffer(); + StringBuilder ret = new StringBuilder(); String rawSig = aGenericType.getErasureSignature(); ret.append(rawSig.substring(0, rawSig.length() - 1)); ret.append("<"); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedMemberImpl.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedMemberImpl.java index fd4cfa48d..ffc9da817 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedMemberImpl.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedMemberImpl.java @@ -468,7 +468,7 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Reso * @return the generic signature for the member that could be inserted into a class file */ public String getSignatureForAttribute() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); if (typeVariables != null) { sb.append("<"); for (TypeVariable typeVariable : typeVariables) { @@ -489,7 +489,7 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Reso } public String getGenericSignature() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); if (typeVariables != null) { sb.append("<"); for (TypeVariable typeVariable : typeVariables) { @@ -912,7 +912,7 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Reso && typeVariableMap.containsKey(((UnresolvedTypeVariableReferenceType) parameterizedComponentSig) .getTypeVariable().getName())) { // pr250632 // TODO ASC bah, this code is rubbish - i should fix it properly - StringBuffer newsig = new StringBuffer(); + StringBuilder newsig = new StringBuilder(); newsig.append("[T"); newsig.append(((UnresolvedTypeVariableReferenceType) parameterizedComponentSig).getTypeVariable().getName()); newsig.append(";"); @@ -1080,7 +1080,7 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Reso } public String getSignatureErased() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append("("); sb.append(getParameterSignatureErased()); sb.append(")"); @@ -1119,7 +1119,7 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Reso * Useful for writing tests, returns *everything* we know about this member. */ public String toDebugString() { - StringBuffer r = new StringBuffer(); + StringBuilder r = new StringBuilder(); // modifiers int mods = modifiers; @@ -1188,7 +1188,7 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Reso public static boolean showParameterNames = true; public String toGenericString() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(getGenericReturnType().getSimpleName()); buf.append(' '); buf.append(declaringType.getName()); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedPointcutDefinition.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedPointcutDefinition.java index 09d0f8ac4..f04867859 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedPointcutDefinition.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedPointcutDefinition.java @@ -64,7 +64,7 @@ public class ResolvedPointcutDefinition extends ResolvedMemberImpl { @Override public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("pointcut "); buf.append((getDeclaringType() == null ? "<nullDeclaringType>" : getDeclaringType().getName())); buf.append("."); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedType.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedType.java index 9f33cab4f..dcf5f21ae 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedType.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedType.java @@ -1784,7 +1784,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl .equals(newFieldTypeMunger.getSignature().getDeclaringType())) { // report error on the aspect - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append("Cannot handle two aspects both attempting to use new style ITDs for the same named field "); sb.append("on the same target type. Please recompile at least one aspect with '-Xset:itdVersion=1'."); sb.append(" Aspects involved: " + munger.getAspectType().getName() + " and " @@ -2262,7 +2262,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl int count = ret.getParameterTypes().length; String[] paramNames = new String[count]; for (int i = 0; i < count; i++) { - paramNames[i] = new StringBuffer("dim").append(i).toString(); + paramNames[i] = new StringBuilder("dim").append(i).toString(); } ret.setParameterNames(paramNames); return ret; diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Shadow.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Shadow.java index 5ab8feae0..6d5520b03 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Shadow.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Shadow.java @@ -657,7 +657,7 @@ public abstract class Shadow { } public String toResolvedString(World world) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append(getKind()); sb.append("("); Member m = getSignature(); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/SignatureUtils.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/SignatureUtils.java index 4df6681aa..1d7f146da 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/SignatureUtils.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/SignatureUtils.java @@ -90,7 +90,7 @@ public class SignatureUtils { // --- private static String getHandlerSignatureString(Member m, World world) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(makeString(0)); buf.append('-'); // buf.append(getName()); @@ -109,7 +109,7 @@ public class SignatureUtils { } private static String getStaticInitializationSignatureString(Member m, World world) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(makeString(m.getModifiers(world))); buf.append('-'); // buf.append(getName()); @@ -120,7 +120,7 @@ public class SignatureUtils { } protected static String getAdviceSignatureString(Member m, World world) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(makeString(m.getModifiers(world))); buf.append('-'); buf.append(m.getName()); @@ -139,7 +139,7 @@ public class SignatureUtils { } protected static String getMethodSignatureString(Member m, World world) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(makeString(m.getModifiers(world))); buf.append('-'); buf.append(m.getName()); @@ -158,7 +158,7 @@ public class SignatureUtils { } protected static String getMonitorSignatureString(Member m, World world) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(makeString(Modifier.STATIC)); // modifiers buf.append('-'); buf.append(m.getName()); // name @@ -173,7 +173,7 @@ public class SignatureUtils { } protected static String getConstructorSignatureString(Member m, World world) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(makeString(m.getModifiers(world))); buf.append('-'); buf.append('-'); @@ -189,7 +189,7 @@ public class SignatureUtils { } protected static String getFieldSignatureString(Member m, World world) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(makeString(m.getModifiers(world))); buf.append('-'); buf.append(m.getName()); @@ -218,7 +218,7 @@ public class SignatureUtils { protected static String makeString(UnresolvedType[] types) { if (types == null) return ""; - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); for (UnresolvedType type : types) { buf.append(makeString(type)); buf.append(':'); @@ -229,7 +229,7 @@ public class SignatureUtils { protected static String makeString(String[] names) { if (names == null) return ""; - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); for (String name : names) { buf.append(name); buf.append(':'); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/StandardAnnotation.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/StandardAnnotation.java index 8d6915396..a90fbee28 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/StandardAnnotation.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/StandardAnnotation.java @@ -45,7 +45,7 @@ public class StandardAnnotation extends AbstractAnnotationAJ { * {@inheritDoc} */ public String stringify() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append("@").append(type.getClassName()); if (hasNameValuePairs()) { sb.append("("); @@ -58,7 +58,7 @@ public class StandardAnnotation extends AbstractAnnotationAJ { } public String toString() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append("Anno[" + getTypeSignature() + " " + (isRuntimeVisible ? "rVis" : "rInvis")); if (nvPairs != null) { sb.append(" "); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/TypeFactory.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/TypeFactory.java index b73c09f1c..69d788f46 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/TypeFactory.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/TypeFactory.java @@ -361,7 +361,7 @@ public class TypeFactory { * something with sig "Pcom/Foo<Ljava/lang/String;>;" signature created = "PSomeType<Pcom/Foo<Ljava/lang/String;>;>;" */ public static UnresolvedType createUnresolvedParameterizedType(String baseTypeSignature, UnresolvedType[] arguments) { - StringBuffer parameterizedSig = new StringBuffer(); + StringBuilder parameterizedSig = new StringBuilder(); parameterizedSig.append(ResolvedType.PARAMETERIZED_TYPE_IDENTIFIER); parameterizedSig.append(baseTypeSignature.substring(1, baseTypeSignature.length() - 1)); if (arguments.length > 0) { diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/TypeVariable.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/TypeVariable.java index 1126fd43c..563ffbe1a 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/TypeVariable.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/TypeVariable.java @@ -224,7 +224,7 @@ public class TypeVariable { } public String getDisplayName() { - StringBuffer ret = new StringBuffer(); + StringBuilder ret = new StringBuilder(); ret.append(name); if (!getFirstBound().getName().equals("java.lang.Object")) { ret.append(" extends "); @@ -251,7 +251,7 @@ public class TypeVariable { * are parameterized types */ public String getSignature() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append(name); sb.append(":"); if (superInterfaces.length == 0 || !superclass.getSignature().equals(UnresolvedType.OBJECT.getSignature())) { @@ -271,7 +271,7 @@ public class TypeVariable { * @return signature for inclusion in an attribute, there must be no 'P' in it signatures */ public String getSignatureForAttribute() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append(name); sb.append(":"); if (superInterfaces.length == 0 || !superclass.getSignature().equals(UnresolvedType.OBJECT.getSignature())) { diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/TypeVariableReferenceType.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/TypeVariableReferenceType.java index 6672c475c..d9b151f05 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/TypeVariableReferenceType.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/TypeVariableReferenceType.java @@ -117,7 +117,7 @@ public class TypeVariableReferenceType extends ReferenceType implements TypeVari */ @Override public String getSignature() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append("T"); sb.append(typeVariable.getName()); sb.append(";"); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/UnresolvedType.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/UnresolvedType.java index 1f314f713..16e3b9879 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/UnresolvedType.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/UnresolvedType.java @@ -451,7 +451,7 @@ public class UnresolvedType implements Traceable, TypeVariableDeclaringElement { name = name.substring(lastDot + 1); } if (isParameterizedType()) { - StringBuffer sb = new StringBuffer(name); + StringBuilder sb = new StringBuilder(name); sb.append("<"); for (int i = 0; i < (typeParameters.length - 1); i++) { sb.append(typeParameters[i].getSimpleName()); @@ -636,13 +636,13 @@ public class UnresolvedType implements Traceable, TypeVariableDeclaringElement { String name = signature.substring(1, signature.length() - 1).replace('/', '.'); return name; case 'T': - StringBuffer nameBuff2 = new StringBuffer(); + StringBuilder nameBuff2 = new StringBuilder(); int colon = signature.indexOf(";"); String tvarName = signature.substring(1, colon); nameBuff2.append(tvarName); return nameBuff2.toString(); case 'P': // it's one of our parameterized type sigs - StringBuffer nameBuff = new StringBuffer(); + StringBuilder nameBuff = new StringBuilder(); // signature for parameterized types is e.g. // List<String> -> Ljava/util/List<Ljava/lang/String;>; // Map<String,List<Integer>> -> Ljava/util/Map<java/lang/String;Ljava/util/List<Ljava/lang/Integer;>;>; @@ -656,7 +656,7 @@ public class UnresolvedType implements Traceable, TypeVariableDeclaringElement { case '<': nameBuff.append("<"); paramNestLevel++; - StringBuffer innerBuff = new StringBuffer(); + StringBuilder innerBuff = new StringBuilder(); while (paramNestLevel > 0) { c = signature.charAt(++i); if (c == '<') { @@ -673,7 +673,7 @@ public class UnresolvedType implements Traceable, TypeVariableDeclaringElement { if (signature.charAt(i + 1) != '>') { nameBuff.append(','); } - innerBuff = new StringBuffer(); + innerBuff = new StringBuilder(); } } nameBuff.append(">"); @@ -757,7 +757,7 @@ public class UnresolvedType implements Traceable, TypeVariableDeclaringElement { // not parameterized return new StringBuilder("L").append(name.replace('.', '/')).append(';').toString(); } else { - StringBuffer nameBuff = new StringBuffer(); + StringBuilder nameBuff = new StringBuilder(); int nestLevel = 0; nameBuff.append("P"); for (int i = 0; i < len; i++) { @@ -769,7 +769,7 @@ public class UnresolvedType implements Traceable, TypeVariableDeclaringElement { case '<': nameBuff.append("<"); nestLevel++; - StringBuffer innerBuff = new StringBuffer(); + StringBuilder innerBuff = new StringBuilder(); while (nestLevel > 0) { c = name.charAt(++i); if (c == '<') { @@ -779,7 +779,7 @@ public class UnresolvedType implements Traceable, TypeVariableDeclaringElement { } if (c == ',' && nestLevel == 1) { nameBuff.append(nameToSignature(innerBuff.toString())); - innerBuff = new StringBuffer(); + innerBuff = new StringBuilder(); } else { if (nestLevel > 0) { innerBuff.append(c); @@ -957,7 +957,7 @@ public class UnresolvedType implements Traceable, TypeVariableDeclaringElement { } public static UnresolvedType makeArray(UnresolvedType base, int dims) { - StringBuffer sig = new StringBuffer(); + StringBuilder sig = new StringBuilder(); for (int i = 0; i < dims; i++) { sig.append("["); } diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/World.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/World.java index b5e6fe362..6eab96f15 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/World.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/World.java @@ -1910,7 +1910,7 @@ public abstract class World implements Dump.INode { MessageUtil.info("Pointcut matching cost (total=" + (totalTime / 1000000) + "ms for " + joinpointCount + " joinpoint match calls):")); for (String p : joinpointsPerPointcut.keySet()) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append("Time:" + (timePerPointcut.get(p) / 1000000) + "ms (jps:#" + joinpointsPerPointcut.get(p) + ") matching against " + p); world.getMessageHandler().handleMessage(MessageUtil.info(sb.toString())); @@ -1925,7 +1925,7 @@ public abstract class World implements Dump.INode { MessageUtil.info("Pointcut fast matching cost (total=" + (totalTime / 1000000) + "ms for " + typeCount + " fast match calls):")); for (String p : fastMatchTimesPerPointcut.keySet()) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append("Time:" + (fastMatchTimesPerPointcut.get(p) / 1000000) + "ms (types:#" + fastMatchTypesPerPointcut.get(p) + ") fast matching against " + p); world.getMessageHandler().handleMessage(MessageUtil.info(sb.toString())); @@ -1962,7 +1962,7 @@ public abstract class World implements Dump.INode { MessageUtil.info("Pointcut matching cost (total=" + (totalTime / 1000000) + "ms for " + joinpointCount + " joinpoint match calls):")); for (String p : joinpointsPerPointcut.keySet()) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append("Time:" + (timePerPointcut.get(p) / 1000000) + "ms (jps:#" + joinpointsPerPointcut.get(p) + ") matching against " + p); world.getMessageHandler().handleMessage(MessageUtil.info(sb.toString())); @@ -2000,7 +2000,7 @@ public abstract class World implements Dump.INode { MessageUtil.info("Pointcut fast matching cost (total=" + (totalTime / 1000000) + "ms for " + typeCount + " fast match calls):")); for (String p : fastMatchTimesPerPointcut.keySet()) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append("Time:" + (fastMatchTimesPerPointcut.get(p) / 1000000) + "ms (types:#" + fastMatchTypesPerPointcut.get(p) + ") fast matching against " + p); world.getMessageHandler().handleMessage(MessageUtil.info(sb.toString())); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/AndTypePattern.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/AndTypePattern.java index 1fc6d1be1..83004d468 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/AndTypePattern.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/AndTypePattern.java @@ -130,7 +130,7 @@ public class AndTypePattern extends TypePattern { @Override public String toString() { - StringBuffer buff = new StringBuffer(); + StringBuilder buff = new StringBuilder(); if (annotationPattern != AnnotationTypePattern.ANY) { buff.append('('); buff.append(annotationPattern.toString()); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/AnnotationPatternList.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/AnnotationPatternList.java index 1e80e1134..d9b61c603 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/AnnotationPatternList.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/AnnotationPatternList.java @@ -138,7 +138,7 @@ public class AnnotationPatternList extends PatternNode { } public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("("); for (int i = 0, len = typePatterns.length; i < len; i++) { AnnotationTypePattern type = typePatterns[i]; diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/AnnotationPointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/AnnotationPointcut.java index 292df0a8a..e751821dc 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/AnnotationPointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/AnnotationPointcut.java @@ -316,7 +316,7 @@ public class AnnotationPointcut extends NameBindingPointcut { } public void buildDeclarationText() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("@annotation("); String annPatt = annotationTypePattern.toString(); buf.append(annPatt.startsWith("@") ? annPatt.substring(1) : annPatt); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ArgsAnnotationPointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ArgsAnnotationPointcut.java index 02eff8395..8494a97b1 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ArgsAnnotationPointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ArgsAnnotationPointcut.java @@ -235,7 +235,7 @@ public class ArgsAnnotationPointcut extends NameBindingPointcut { * @see java.lang.Object#toString() */ private void buildDeclarationText() { - StringBuffer buf = new StringBuffer("@args"); + StringBuilder buf = new StringBuilder("@args"); buf.append(arguments.toString()); this.declarationText = buf.toString(); } diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/BasicTokenSource.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/BasicTokenSource.java index 7656bc2d8..70b9c398c 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/BasicTokenSource.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/BasicTokenSource.java @@ -63,7 +63,7 @@ public class BasicTokenSource implements ITokenSource { } public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("["); for (int i = 0; i < tokens.length; i++) { IToken t = tokens[i]; diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/Bindings.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/Bindings.java index de86f5639..72d438210 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/Bindings.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/Bindings.java @@ -69,7 +69,7 @@ public class Bindings { } public String toString() { - StringBuffer buf = new StringBuffer("Bindings("); + StringBuilder buf = new StringBuilder("Bindings("); for (int i = 0, len = bindings.length; i < len; i++) { if (i > 0) buf.append(", "); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/CflowPointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/CflowPointcut.java index bd7bdb952..0c746239f 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/CflowPointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/CflowPointcut.java @@ -316,7 +316,7 @@ public class CflowPointcut extends Pointcut { } private String getKey(Pointcut p, ResolvedType a, String stackOrCounter) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append(a.getName()); sb.append("::"); sb.append(p.toString()); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclareErrorOrWarning.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclareErrorOrWarning.java index dae13ec1c..de04e61f4 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclareErrorOrWarning.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclareErrorOrWarning.java @@ -36,7 +36,7 @@ public class DeclareErrorOrWarning extends Declare { * returns "declare warning: <message>" or "declare error: <message>" */ public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("declare "); if (isError) { buf.append("error: "); @@ -118,7 +118,7 @@ public class DeclareErrorOrWarning extends Declare { * returns "declare warning" or "declare error" */ public String getName() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("declare "); if (isError) { buf.append("error"); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclareParents.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclareParents.java index f3f9f2b62..32e4654e3 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclareParents.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclareParents.java @@ -76,7 +76,7 @@ public class DeclareParents extends Declare { @Override public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("declare parents: "); buf.append(child); buf.append(isExtends ? " extends " : " implements "); // extends and implements are treated equivalently diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclareParentsMixin.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclareParentsMixin.java index fc63a6e5e..206bd4b1c 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclareParentsMixin.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclareParentsMixin.java @@ -66,7 +66,7 @@ public class DeclareParentsMixin extends DeclareParents { } public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("declare parents mixin: "); buf.append(child); buf.append(" implements "); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclarePrecedence.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclarePrecedence.java index 504a7e6c0..880fd8e44 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclarePrecedence.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclarePrecedence.java @@ -47,7 +47,7 @@ public class DeclarePrecedence extends Declare { } public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("declare precedence: "); buf.append(patterns); buf.append(";"); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclareSoft.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclareSoft.java index 4b8be00de..3384f3346 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclareSoft.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclareSoft.java @@ -49,7 +49,7 @@ public class DeclareSoft extends Declare { @Override public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("declare soft: "); buf.append(exception); buf.append(": "); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclareTypeErrorOrWarning.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclareTypeErrorOrWarning.java index a6ae608c6..8f7954a1b 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclareTypeErrorOrWarning.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/DeclareTypeErrorOrWarning.java @@ -41,7 +41,7 @@ public class DeclareTypeErrorOrWarning extends Declare { * returns "declare warning: <typepattern>: <message>" or "declare error: <typepattern>: <message>" */ public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("declare "); if (isError) { buf.append("error: "); @@ -123,7 +123,7 @@ public class DeclareTypeErrorOrWarning extends Declare { * returns "declare type warning" or "declare type error" */ public String getName() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("declare type "); if (isError) { buf.append("error"); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ExactAnnotationFieldTypePattern.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ExactAnnotationFieldTypePattern.java index b13cb34e7..73d6b5c58 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ExactAnnotationFieldTypePattern.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ExactAnnotationFieldTypePattern.java @@ -243,7 +243,7 @@ public class ExactAnnotationFieldTypePattern extends ExactAnnotationTypePattern if (!resolved && formalName != null) { return formalName; } - StringBuffer ret = new StringBuffer(); + StringBuilder ret = new StringBuilder(); ret.append("@").append(annotationType.toString()); ret.append("(").append(formalName).append(")"); return ret.toString(); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ExactTypePattern.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ExactTypePattern.java index b75ad764f..bedbc4732 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ExactTypePattern.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ExactTypePattern.java @@ -284,7 +284,7 @@ public class ExactTypePattern extends TypePattern { @Override public String toString() { - StringBuffer buff = new StringBuffer(); + StringBuilder buff = new StringBuilder(); if (annotationPattern != AnnotationTypePattern.ANY) { buff.append('('); buff.append(annotationPattern.toString()); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/HandlerPointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/HandlerPointcut.java index 0fa172ec7..c2ab41811 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/HandlerPointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/HandlerPointcut.java @@ -84,7 +84,7 @@ public class HandlerPointcut extends Pointcut { } public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("handler("); buf.append(exceptionType.toString()); buf.append(")"); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/HasMemberTypePattern.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/HasMemberTypePattern.java index 38512a73f..af5ab567e 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/HasMemberTypePattern.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/HasMemberTypePattern.java @@ -162,7 +162,7 @@ public class HasMemberTypePattern extends TypePattern { @Override public String toString() { - StringBuffer buff = new StringBuffer(); + StringBuilder buff = new StringBuilder(); if (signaturePattern.getKind() == Member.FIELD) { buff.append("hasfield("); } else { diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/IfPointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/IfPointcut.java index e1e747e35..40014cda4 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/IfPointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/IfPointcut.java @@ -273,7 +273,7 @@ public class IfPointcut extends Pointcut { } else { if (state.size() == 0 || currentStateIndex > state.size()) { String[] paramNames = testMethod.getParameterNames(); - StringBuffer errorParameter = new StringBuffer(); + StringBuilder errorParameter = new StringBuilder(); if (paramNames != null) { errorParameter.append(testMethod.getParameterTypes()[i].getName()).append(" "); errorParameter.append(paramNames[i]); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/KindedPointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/KindedPointcut.java index 317899970..278ff8f5b 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/KindedPointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/KindedPointcut.java @@ -309,7 +309,7 @@ public class KindedPointcut extends Pointcut { @Override public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(kind.getSimpleName()); buf.append("("); buf.append(signature.toString()); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/NotTypePattern.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/NotTypePattern.java index 8bb04673a..dca24c8f3 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/NotTypePattern.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/NotTypePattern.java @@ -128,7 +128,7 @@ public class NotTypePattern extends TypePattern { @Override public String toString() { - StringBuffer buff = new StringBuffer(); + StringBuilder buff = new StringBuilder(); if (annotationPattern != AnnotationTypePattern.ANY) { buff.append('('); buff.append(annotationPattern.toString()); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/OrTypePattern.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/OrTypePattern.java index 27c565c3f..4d0f9157f 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/OrTypePattern.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/OrTypePattern.java @@ -133,7 +133,7 @@ public class OrTypePattern extends TypePattern { } public String toString() { - StringBuffer buff = new StringBuffer(); + StringBuilder buff = new StringBuilder(); if (annotationPattern != AnnotationTypePattern.ANY) { buff.append('('); buff.append(annotationPattern.toString()); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/PatternParser.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/PatternParser.java index e355f4a91..b573ea5e9 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/PatternParser.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/PatternParser.java @@ -660,7 +660,7 @@ public class PatternParser { private Pointcut parseDesignatorPointcut(PointcutDesignatorHandler pcdHandler) { eat("("); int parenCount = 1; - StringBuffer pointcutBody = new StringBuffer(); + StringBuilder pointcutBody = new StringBuilder(); while (parenCount > 0) { if (maybeEat("(")) { parenCount++; @@ -1203,7 +1203,7 @@ public class PatternParser { private ExactAnnotationTypePattern parseSimpleAnnotationName() { // the @ has already been eaten... ExactAnnotationTypePattern p; - StringBuffer annotationName = new StringBuffer(); + StringBuilder annotationName = new StringBuilder(); annotationName.append(parseIdentifier()); while (maybeEat(".")) { annotationName.append('.'); @@ -1243,7 +1243,7 @@ public class PatternParser { public List<NamePattern> parseDottedNamePattern() { List<NamePattern> names = new ArrayList<>(); - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); IToken previous = null; boolean justProcessedEllipsis = false; // Remember if we just dealt with an ellipsis (PR61536) boolean justProcessedDot = false; @@ -1329,7 +1329,7 @@ public class PatternParser { // supported form 'a.b.c.d' or just 'a' public String parseAnnotationNameValuePattern() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); IToken tok; // int startPos = tokenSource.peek().getStart(); @@ -1379,7 +1379,7 @@ public class PatternParser { } public NamePattern parseNamePattern() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); IToken previous = null; IToken tok; int startPos = tokenSource.peek().getStart(); @@ -1765,7 +1765,7 @@ public class PatternParser { } public String parsePossibleStringSequence(boolean shouldEnd) { - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); IToken token = tokenSource.next(); if (token.getLiteralKind() == null) { diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ReferencePointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ReferencePointcut.java index 404057756..030131414 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ReferencePointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ReferencePointcut.java @@ -82,7 +82,7 @@ public class ReferencePointcut extends Pointcut { } public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); if (onType != null) { buf.append(onType); buf.append("."); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/SignaturePattern.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/SignaturePattern.java index 323308d79..250d125b8 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/SignaturePattern.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/SignaturePattern.java @@ -149,7 +149,7 @@ public class SignaturePattern extends PatternNode implements ISignaturePattern { private void reportUnmatchedTargetKindMessage(AnnotationTargetKind[] annotationTargetKinds, PatternNode node, IScope scope, boolean checkMatchesMemberKindName) { - StringBuffer targetNames = new StringBuffer("{"); + StringBuilder targetNames = new StringBuilder("{"); for (int i = 0; i < annotationTargetKinds.length; i++) { AnnotationTargetKind targetKind = annotationTargetKinds[i]; if (checkMatchesMemberKindName && kind.getName().equals(targetKind.getName())) { @@ -819,7 +819,7 @@ public class SignaturePattern extends PatternNode implements ISignaturePattern { @Override public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); if (annotationPattern != AnnotationTypePattern.ANY) { buf.append(annotationPattern.toString()); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ThisOrTargetAnnotationPointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ThisOrTargetAnnotationPointcut.java index 9e3fe33f8..83774bcb7 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ThisOrTargetAnnotationPointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ThisOrTargetAnnotationPointcut.java @@ -317,7 +317,7 @@ public class ThisOrTargetAnnotationPointcut extends NameBindingPointcut { * @see java.lang.Object#toString() */ private void buildDeclarationText() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(isThis ? "@this(" : "@target("); String annPatt = annotationTypePattern.toString(); buf.append(annPatt.startsWith("@") ? annPatt.substring(1) : annPatt); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/TypePatternList.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/TypePatternList.java index 1650514b0..4d9a28e2d 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/TypePatternList.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/TypePatternList.java @@ -72,7 +72,7 @@ public class TypePatternList extends PatternNode { @Override public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("("); for (int i = 0, len = typePatterns.length; i < len; i++) { TypePattern type = typePatterns[i]; diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/TypePatternQuestions.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/TypePatternQuestions.java index be6d01a3b..da227d6ec 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/TypePatternQuestions.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/TypePatternQuestions.java @@ -51,7 +51,7 @@ public class TypePatternQuestions { } public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("TypePatternQuestions{"); for (Map.Entry<Question,FuzzyBoolean> entry: questionsAndAnswers.entrySet()) { Question question = (Question)entry.getKey(); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/TypeVariablePattern.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/TypeVariablePattern.java index 18b13172d..f887a4077 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/TypeVariablePattern.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/TypeVariablePattern.java @@ -171,7 +171,7 @@ public class TypeVariablePattern extends PatternNode { } public String toString() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append(name); sb.append(getExtendsClause()); if (interfaceBounds != null) { diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WildTypePattern.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WildTypePattern.java index 43a59df10..671989cd0 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WildTypePattern.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WildTypePattern.java @@ -569,7 +569,7 @@ public class WildTypePattern extends TypePattern { throw new RuntimeException("bad name: " + namePatterns); } // System.out.println("get clean: " + this); - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); for (int i = 0, len = namePatterns.length; i < len; i++) { NamePattern p = namePatterns[i]; String simpleName = p.maybeGetSimpleName(); @@ -1179,7 +1179,7 @@ public class WildTypePattern extends TypePattern { @Override public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); if (annotationPattern != AnnotationTypePattern.ANY) { buf.append('('); buf.append(annotationPattern.toString()); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithinAnnotationPointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithinAnnotationPointcut.java index b1a93a21f..ba568a3fd 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithinAnnotationPointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithinAnnotationPointcut.java @@ -221,7 +221,7 @@ public class WithinAnnotationPointcut extends NameBindingPointcut { * @see java.lang.Object#toString() */ private void buildDeclarationText() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("@within("); String annPatt = annotationTypePattern.toString(); buf.append(annPatt.startsWith("@") ? annPatt.substring(1) : annPatt); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithinCodeAnnotationPointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithinCodeAnnotationPointcut.java index af65c8165..7c0458935 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithinCodeAnnotationPointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WithinCodeAnnotationPointcut.java @@ -212,7 +212,7 @@ public class WithinCodeAnnotationPointcut extends NameBindingPointcut { } private void buildDeclarationText() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("@withincode("); String annPatt = annotationTypePattern.toString(); buf.append(annPatt.startsWith("@") ? annPatt.substring(1) : annPatt); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/AbstractTrace.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/AbstractTrace.java index a141b5b4c..8b77c1a00 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/AbstractTrace.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/AbstractTrace.java @@ -95,7 +95,7 @@ public abstract class AbstractTrace implements Trace { * Formatting */ protected String formatMessage(String kind, String className, String methodName, Object thiz, Object[] args) { - StringBuffer message = new StringBuffer(); + StringBuilder message = new StringBuilder(); Date now = new Date(); message.append(formatDate(now)).append(" "); message.append(Thread.currentThread().getName()).append(" "); @@ -116,7 +116,7 @@ public abstract class AbstractTrace implements Trace { } protected String formatMessage(String kind, String text, Throwable th) { - StringBuffer message = new StringBuffer(); + StringBuilder message = new StringBuilder(); Date now = new Date(); message.append(formatDate(now)).append(" "); message.append(Thread.currentThread().getName()).append(" "); @@ -193,7 +193,7 @@ public abstract class AbstractTrace implements Trace { * @return the formated list */ protected String formatArgs(Object[] args) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); for (int i = 0; i < args.length; i++) { sb.append(formatObj(args[i])); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/PointcutParser.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/PointcutParser.java index 80612362c..0e5b807b8 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/PointcutParser.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/PointcutParser.java @@ -559,7 +559,7 @@ public class PointcutParser { } private String buildUserMessageFromParserException(String pc, ParserException ex) { - StringBuffer msg = new StringBuffer(); + StringBuilder msg = new StringBuilder(); msg.append("Pointcut is not well-formed: expecting '"); msg.append(ex.getMessage()); msg.append("'"); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/StandardPointcutParser.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/StandardPointcutParser.java index 1fdb29055..6bab3f507 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/StandardPointcutParser.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/StandardPointcutParser.java @@ -485,7 +485,7 @@ public class StandardPointcutParser { } private String buildUserMessageFromParserException(String pc, ParserException ex) { - StringBuffer msg = new StringBuffer(); + StringBuilder msg = new StringBuilder(); msg.append("Pointcut is not well-formed: expecting '"); msg.append(ex.getMessage()); msg.append("'"); diff --git a/org.aspectj.matcher/src/test/java/org/aspectj/weaver/patterns/ParserTestCase.java b/org.aspectj.matcher/src/test/java/org/aspectj/weaver/patterns/ParserTestCase.java index 31897365f..8c7258d59 100644 --- a/org.aspectj.matcher/src/test/java/org/aspectj/weaver/patterns/ParserTestCase.java +++ b/org.aspectj.matcher/src/test/java/org/aspectj/weaver/patterns/ParserTestCase.java @@ -702,7 +702,7 @@ public class ParserTestCase extends PatternsTestCase { Set<String> keys = m.keySet(); List<String> orderedKeys = new ArrayList<>(keys); Collections.sort(orderedKeys); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); for (Iterator<String> iterator = orderedKeys.iterator(); iterator.hasNext();) { String object = (String) iterator.next(); sb.append(object).append("=").append(m.get(object)); |