* Move almost all uses of StringBuffer to StringBuilder,

for efficiency (thanks Arsene for the suggestion)
This commit is contained in:
zzz
2009-07-01 16:00:43 +00:00
parent 055cd99dde
commit abc23e9a49
198 changed files with 407 additions and 368 deletions

View File

@ -107,25 +107,25 @@ public class GarlicClove extends DataStructureImpl {
public void writeBytes(OutputStream out) throws DataFormatException, IOException {
StringBuffer error = null;
StringBuilder error = null;
if (_instructions == null) {
if (error == null) error = new StringBuffer();
if (error == null) error = new StringBuilder();
error.append("No instructions ");
}
if (_msg == null) {
if (error == null) error = new StringBuffer();
if (error == null) error = new StringBuilder();
error.append("No message ");
}
if (_cloveId < 0) {
if (error == null) error = new StringBuffer();
if (error == null) error = new StringBuilder();
error.append("CloveID < 0 [").append(_cloveId).append("] ");
}
if (_expiration == null) {
if (error == null) error = new StringBuffer();
if (error == null) error = new StringBuilder();
error.append("Expiration is null ");
}
if (_certificate == null) {
if (error == null) error = new StringBuffer();
if (error == null) error = new StringBuilder();
error.append("Certificate is null ");
}
@ -210,7 +210,7 @@ public class GarlicClove extends DataStructureImpl {
@Override
public String toString() {
StringBuffer buf = new StringBuffer(128);
StringBuilder buf = new StringBuilder(128);
buf.append("[GarlicClove: ");
buf.append("\n\tInstructions: ").append(getInstructions());
buf.append("\n\tCertificate: ").append(getCertificate());