Replace instances of StringBuffer with StringBuilder

This commit is contained in:
Federico Bond
2014-08-25 00:06:32 -03:00
parent f6611eddf1
commit 768c72e4e8
26 changed files with 129 additions and 147 deletions

View File

@@ -103,8 +103,8 @@ public class Compiler {
// PApplet.println(command);
try {
// Load errors into a local StringBuffer
final StringBuffer errorBuffer = new StringBuffer();
// Load errors into a local StringBuilder
final StringBuilder errorBuffer = new StringBuilder();
// Create single method dummy writer class to slurp errors from ecj
Writer internalWriter = new Writer() {

View File

@@ -234,7 +234,7 @@ public class JavaBuild {
// 1. concatenate all .pde files to the 'main' pde
// store line number for starting point of each code bit
StringBuffer bigCode = new StringBuffer();
StringBuilder bigCode = new StringBuilder();
int bigCount = 0;
for (SketchCode sc : sketch.getCode()) {
if (sc.isExtension("pde")) {
@@ -1417,7 +1417,7 @@ public class JavaBuild {
String jarList[] = new String[jarListVector.size()];
jarListVector.copyInto(jarList);
StringBuffer exportClassPath = new StringBuffer();
StringBuilder exportClassPath = new StringBuilder();
if (exportPlatform == PConstants.MACOSX) {
for (int i = 0; i < jarList.length; i++) {
@@ -1474,7 +1474,7 @@ public class JavaBuild {
String lines[] = PApplet.loadStrings(plistTemplate);
for (int i = 0; i < lines.length; i++) {
if (lines[i].indexOf("@@") != -1) {
StringBuffer sb = new StringBuffer(lines[i]);
StringBuilder sb = new StringBuilder(lines[i]);
int index = 0;
while ((index = sb.indexOf("@@jvm_runtime@@")) != -1) {
sb.replace(index, index + "@@jvm_runtime@@".length(),

View File

@@ -791,15 +791,15 @@ public class JavaEditor extends Editor {
// statement is already in there, but if the user has the import
// commented out, then this will be a problem.
String[] list = Base.packageListFromClassPath(jarPath);
StringBuffer buffer = new StringBuffer();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < list.length; i++) {
buffer.append("import ");
buffer.append(list[i]);
buffer.append(".*;\n");
sb.append("import ");
sb.append(list[i]);
sb.append(".*;\n");
}
buffer.append('\n');
buffer.append(getText());
setText(buffer.toString());
sb.append('\n');
sb.append(getText());
setText(sb.toString());
setSelection(0, 0); // scroll to start
sketch.setModified(true);
}