Change StringBuffer in favor of StringBuilder.master
@@ -173,7 +173,7 @@ public abstract class BaseFilterReader extends FilterReader { | |||||
return null; | return null; | ||||
} | } | ||||
StringBuffer line = new StringBuffer(); | |||||
final StringBuilder line = new StringBuilder(); | |||||
while (ch != -1) { | while (ch != -1) { | ||||
line.append((char) ch); | line.append((char) ch); | ||||
@@ -370,7 +370,7 @@ public class TokenFilter extends BaseFilterReader | |||||
if (from == null) { | if (from == null) { | ||||
throw new BuildException("Missing from in stringreplace"); | throw new BuildException("Missing from in stringreplace"); | ||||
} | } | ||||
StringBuffer ret = new StringBuffer(); | |||||
final StringBuilder ret = new StringBuilder(); | |||||
int start = 0; | int start = 0; | ||||
int found = line.indexOf(from); | int found = line.indexOf(from); | ||||
while (found >= 0) { | while (found >= 0) { | ||||
@@ -620,7 +620,7 @@ public class TokenFilter extends BaseFilterReader | |||||
* @return the converted string | * @return the converted string | ||||
*/ | */ | ||||
public String filter(String string) { | public String filter(String string) { | ||||
StringBuffer output = new StringBuffer(string.length()); | |||||
StringBuilder output = new StringBuilder(string.length()); | |||||
for (int i = 0; i < string.length(); ++i) { | for (int i = 0; i < string.length(); ++i) { | ||||
char ch = string.charAt(i); | char ch = string.charAt(i); | ||||
if (!(isDeleteCharacter(ch))) { | if (!(isDeleteCharacter(ch))) { | ||||
@@ -167,7 +167,7 @@ public class KeySubst extends Task { | |||||
*/ | */ | ||||
public static String replace(String origString, Hashtable<String, String> keys) | public static String replace(String origString, Hashtable<String, String> keys) | ||||
throws BuildException { | throws BuildException { | ||||
StringBuffer finalString = new StringBuffer(); | |||||
final StringBuilder finalString = new StringBuilder(); | |||||
int index = 0; | int index = 0; | ||||
int i = 0; | int i = 0; | ||||
String key = null; | String key = null; | ||||
@@ -188,7 +188,7 @@ public class RecorderEntry implements BuildLogger, SubBuildListener { | |||||
public void messageLogged(BuildEvent event) { | public void messageLogged(BuildEvent event) { | ||||
log("--- MESSAGE LOGGED", Project.MSG_DEBUG); | log("--- MESSAGE LOGGED", Project.MSG_DEBUG); | ||||
StringBuffer buf = new StringBuffer(); | |||||
final StringBuilder buf = new StringBuilder(); | |||||
if (event.getTask() != null) { | if (event.getTask() != null) { | ||||
String name = event.getTask().getTaskName(); | String name = event.getTask().getTaskName(); | ||||
@@ -704,7 +704,7 @@ public class Redirector { | |||||
} | } | ||||
((ConcatFileInputStream) inputStream).setManagingComponent(managingTask); | ((ConcatFileInputStream) inputStream).setManagingComponent(managingTask); | ||||
} else if (inputString != null) { | } else if (inputString != null) { | ||||
final StringBuffer buf = new StringBuffer("Using input "); | |||||
final StringBuilder buf = new StringBuilder("Using input "); | |||||
if (logInputString) { | if (logInputString) { | ||||
buf.append('"').append(inputString).append('"'); | buf.append('"').append(inputString).append('"'); | ||||
} else { | } else { | ||||
@@ -550,7 +550,7 @@ public class TraXLiaison implements XSLTLiaison4, ErrorListener, XSLTLoggerAware | |||||
return; | return; | ||||
} | } | ||||
final StringBuffer msg = new StringBuffer(); | |||||
final StringBuilder msg = new StringBuilder(); | |||||
final SourceLocator locator = e.getLocator(); | final SourceLocator locator = e.getLocator(); | ||||
if (locator != null) { | if (locator != null) { | ||||
final String systemid = locator.getSystemId(); | final String systemid = locator.getSystemId(); | ||||
@@ -745,7 +745,7 @@ public abstract class MSVSS extends Task implements MSVSSConstants { | |||||
* @return The command line as a string with out the password | * @return The command line as a string with out the password | ||||
*/ | */ | ||||
private String formatCommandLine(Commandline cmd) { | private String formatCommandLine(Commandline cmd) { | ||||
StringBuffer sBuff = new StringBuffer(cmd.toString()); | |||||
final StringBuilder sBuff = new StringBuilder(cmd.toString()); | |||||
int indexUser = sBuff.substring(0).indexOf(FLAG_LOGIN); | int indexUser = sBuff.substring(0).indexOf(FLAG_LOGIN); | ||||
if (indexUser > 0) { | if (indexUser > 0) { | ||||
int indexPass = sBuff.substring(0).indexOf(",", indexUser); | int indexPass = sBuff.substring(0).indexOf(",", indexUser); | ||||
@@ -822,7 +822,7 @@ public class FileUtils { | |||||
//remove the initial separator; the root has it. | //remove the initial separator; the root has it. | ||||
next = (ca[next] == sep) ? next + 1 : next; | next = (ca[next] == sep) ? next + 1 : next; | ||||
StringBuffer sbPath = new StringBuffer(); | |||||
final StringBuilder sbPath = new StringBuilder(); | |||||
// Eliminate consecutive slashes after the drive spec: | // Eliminate consecutive slashes after the drive spec: | ||||
for (int i = next; i < ca.length; i++) { | for (int i = next; i < ca.length; i++) { | ||||
if (ca[i] != sep || ca[i - 1] != sep) { | if (ca[i] != sep || ca[i - 1] != sep) { | ||||