Switching StringBuffer to StringBuilder throughout the codebase (APIs permitting).

This commit is contained in:
Luke Taylor 2009-12-18 18:44:42 +00:00
parent fac07ba8ff
commit aeed49393c
21 changed files with 22 additions and 22 deletions

View File

@ -160,7 +160,7 @@ public class AccessControlEntryImpl implements AccessControlEntry, AuditableAcce
}
public String toString() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append("AccessControlEntryImpl[");
sb.append("id: ").append(this.id).append("; ");
sb.append("granting: ").append(this.granting).append("; ");

View File

@ -121,7 +121,7 @@ public class CasAuthenticationToken extends AbstractAuthenticationToken implemen
}
public String toString() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(super.toString());
sb.append(" Assertion: ").append(this.assertion);
sb.append(" Credentials (Service/Proxy Ticket): ").append(this.credentials);

View File

@ -73,7 +73,7 @@ public class RunAsUserToken extends AbstractAuthenticationToken {
}
public String toString() {
StringBuffer sb = new StringBuffer(super.toString());
StringBuilder sb = new StringBuilder(super.toString());
sb.append("; Original Class: ").append(this.originalAuthentication.getName());
return sb.toString();

View File

@ -59,7 +59,7 @@ public class AuthenticationDetails implements Serializable {
}
public String toString() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(super.toString() + ": ");
sb.append("Context: " + this.getContext());

View File

@ -19,7 +19,7 @@ public class GrantedAuthoritiesContainerImpl implements MutableGrantedAuthoritie
}
public String toString() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append("Authorities: ").append(authorities);
return sb.toString();
}

View File

@ -66,7 +66,7 @@ public class SecurityContextImpl implements SecurityContext {
}
public String toString() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(super.toString());
if (this.authentication == null) {

View File

@ -91,7 +91,7 @@ public class KeyBasedPersistenceTokenService implements TokenService, Initializi
String pseudoRandomNumber = tokens[1];
// Permit extendedInfo to itself contain ":" characters
StringBuffer extendedInfo = new StringBuffer();
StringBuilder extendedInfo = new StringBuilder();
for (int i = 2; i < tokens.length-1; i++) {
if (i > 2) {
extendedInfo.append(":");

View File

@ -199,7 +199,7 @@ public class SpringSecurityLdapTemplate extends LdapTemplate {
SearchResult searchResult = resultsEnum.next();
// Work out the DN of the matched entry
StringBuffer dn = new StringBuffer(searchResult.getName());
StringBuilder dn = new StringBuilder(searchResult.getName());
if (base.length() > 0) {
dn.append(",");

View File

@ -168,7 +168,7 @@ public class FilterBasedLdapUserSearch implements LdapUserSearch {
}
public String toString() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append("[ searchFilter: '").append(searchFilter).append("', ");
sb.append("searchBase: '").append(searchBase).append("'");

View File

@ -82,7 +82,7 @@ public class Contact implements Serializable {
}
public String toString() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(super.toString() + ": ");
sb.append("Id: " + this.getId() + "; ");
sb.append("Name: " + this.getName() + "; ");

View File

@ -70,7 +70,7 @@ public abstract class AbstractElement {
currentElement = currentElement.getParent();
}
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
String lastCharacter = null;
for (Iterator<String> i = strings.iterator(); i.hasNext();) {
String token = i.next();

View File

@ -176,7 +176,7 @@ public class PasswordPolicyResponseControl extends PasswordPolicyControl {
* @return error and warning messages
*/
public String toString() {
StringBuffer sb = new StringBuffer("PasswordPolicyResponseControl");
StringBuilder sb = new StringBuilder("PasswordPolicyResponseControl");
if (hasError()) {
sb.append(", error: ").append(errorText[errorCode]);

View File

@ -305,7 +305,7 @@ public class FilterChainProxy extends GenericFilterBean {
}
public String toString() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append("FilterChainProxy[");
sb.append(" UrlMatcher = ").append(matcher);
sb.append("; Filter Chains: ");

View File

@ -56,7 +56,7 @@ public class RequestKey {
}
public String toString() {
StringBuffer sb = new StringBuffer(url.length() + 7);
StringBuilder sb = new StringBuilder(url.length() + 7);
sb.append("[");
if (method != null) {
sb.append(method).append(",");

View File

@ -132,7 +132,7 @@ public class WebAuthenticationDetails implements SessionIdentifierAware, Seriali
}
public String toString() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(super.toString() + ": ");
sb.append("RemoteIpAddress: " + this.getRemoteAddress() + "; ");
sb.append("SessionId: " + this.getSessionId());

View File

@ -29,7 +29,7 @@ public class PreAuthenticatedGrantedAuthoritiesAuthenticationDetails extends Aut
* @return The String representation of this object.
*/
public String toString() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(super.toString() + "; ");
sb.append("preAuthenticatedGrantedAuthorities: " + preAuthenticatedGrantedAuthorities);
return sb.toString();

View File

@ -36,7 +36,7 @@ public class PreAuthenticatedGrantedAuthoritiesWebAuthenticationDetails extends
}
public String toString() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(super.toString() + "; ");
sb.append(authoritiesContainer);
return sb.toString();

View File

@ -176,7 +176,7 @@ public abstract class AbstractRememberMeServices implements RememberMeServices,
* @return base64 encoding of the tokens concatenated with the ":" delimiter.
*/
protected String encodeCookie(String[] cookieTokens) {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
for(int i=0; i < cookieTokens.length; i++) {
sb.append(cookieTokens[i]);
@ -187,7 +187,7 @@ public abstract class AbstractRememberMeServices implements RememberMeServices,
String value = sb.toString();
sb = new StringBuffer(new String(Base64.encode(value.getBytes())));
sb = new StringBuilder(new String(Base64.encode(value.getBytes())));
while (sb.charAt(sb.length() - 1) == '=') {
sb.deleteCharAt(sb.length() - 1);

View File

@ -109,7 +109,7 @@ public class DefaultLoginPageGeneratingFilter extends GenericFilterBean {
}
}
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append("<html><head><title>Login Page</title></head>");

View File

@ -52,7 +52,7 @@ public class RedirectUrlBuilder {
}
public String getUrl() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
Assert.notNull(scheme);
Assert.notNull(serverName);

View File

@ -13,7 +13,7 @@ public abstract class TextEscapeUtils {
return s;
}
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
for (int i=0; i < s.length(); i++) {
char c = s.charAt(i);