StringBuffer -> StringBuilder switchovers

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7344 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Brian Remedios
2011-09-25 03:58:24 +00:00
parent 1ed5e370a7
commit 70f6cf2def
4 changed files with 6 additions and 6 deletions

View File

@ -31,14 +31,14 @@ import net.sourceforge.pmd.lang.java.typeresolution.TypeHelper;
import net.sourceforge.pmd.lang.rule.properties.IntegerProperty;
/**
* This rule finds concurrent calls to StringBuffer.append where String literals
* This rule finds concurrent calls to StringBuffer/Builder.append where String literals
* are used It would be much better to make these calls using one call to
* .append
* <p/>
* example:
* <p/>
* <pre>
* StringBuffer buf = new StringBuffer();
* StringBuilder buf = new StringBuilder();
* buf.append(&quot;Hello&quot;);
* buf.append(&quot; &quot;).append(&quot;World&quot;);
* </pre>
@ -46,7 +46,7 @@ import net.sourceforge.pmd.lang.rule.properties.IntegerProperty;
* This would be more eloquently put as:
* <p/>
* <pre>
* StringBuffer buf = new StringBuffer();
* StringBuilder buf = new StringBuilder();
* buf.append(&quot;Hello World&quot;);
* </pre>
* <p/>

View File

@ -50,7 +50,7 @@ public abstract class AbstractScope implements Scope {
protected abstract NameDeclaration findVariableHere(NameOccurrence occurrence);
protected <T> String glomNames(Set<T> s) {
StringBuffer result = new StringBuffer();
StringBuilder result = new StringBuilder();
for (T t: s) {
result.append(t.toString());
result.append(',');

View File

@ -35,7 +35,7 @@ public class MethodNameDeclaration extends AbstractNameDeclaration {
}
public String getParameterDisplaySignature() {
StringBuffer sb = new StringBuffer("(");
StringBuilder sb = new StringBuilder("(");
ASTFormalParameters params = (ASTFormalParameters) node.jjtGetChild(0);
// TODO - this can be optimized - add [0] then ,[n] in a loop.
// no need to trim at the end

View File

@ -69,7 +69,7 @@ public class NameFinder {
@Override
public String toString() {
StringBuffer result = new StringBuffer();
StringBuilder result = new StringBuilder();
for (NameOccurrence occ: names) {
result.append(occ.getImage());
}