Use StringBuilder instead of StringBuffer

This commit is contained in:
Sam Harwell 2012-07-18 15:49:12 -05:00
parent 2056e019a5
commit 6259ab5c9e
3 changed files with 4 additions and 4 deletions

View File

@ -385,7 +385,7 @@ public class Grammar implements AttributeResolver {
List<Grammar> grammarsFromRootToMe = getOutermostGrammar().getGrammarAncestors();
String qualifiedName = name;
if ( grammarsFromRootToMe!=null ) {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
for (Grammar g : grammarsFromRootToMe) {
buf.append(g.name);
buf.append('_');

View File

@ -775,7 +775,7 @@ public abstract class BaseTest {
}
public static class StreamVacuum implements Runnable {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
BufferedReader in;
Thread sucker;
public StreamVacuum(InputStream in) {

View File

@ -54,7 +54,7 @@ public class TestFastQueue {
q.add("c");
q.add("d");
q.add("e");
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
while ( q.size()>0 ) {
String o = q.remove();
buf.append(o);
@ -67,7 +67,7 @@ public class TestFastQueue {
}
@Test public void testQueueThenRemoveOneByOne() throws Exception {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
FastQueue<String> q = new FastQueue<String>();
q.add("a");
buf.append(q.remove());