Switching StringBuffer to StringBuilder throughout the codebase (APIs permitting).
This commit is contained in:
parent
fac07ba8ff
commit
aeed49393c
|
@ -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("; ");
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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());
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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(":");
|
||||
|
|
|
@ -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(",");
|
||||
|
|
|
@ -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("'");
|
||||
|
|
|
@ -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() + "; ");
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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]);
|
||||
|
|
|
@ -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: ");
|
||||
|
|
|
@ -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(",");
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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>");
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ public class RedirectUrlBuilder {
|
|||
}
|
||||
|
||||
public String getUrl() {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
Assert.notNull(scheme);
|
||||
Assert.notNull(serverName);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue