diff --git a/acl/src/main/java/org/springframework/security/acls/domain/AccessControlEntryImpl.java b/acl/src/main/java/org/springframework/security/acls/domain/AccessControlEntryImpl.java index b1e2a4a234..4729631307 100644 --- a/acl/src/main/java/org/springframework/security/acls/domain/AccessControlEntryImpl.java +++ b/acl/src/main/java/org/springframework/security/acls/domain/AccessControlEntryImpl.java @@ -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("; "); diff --git a/cas/src/main/java/org/springframework/security/cas/authentication/CasAuthenticationToken.java b/cas/src/main/java/org/springframework/security/cas/authentication/CasAuthenticationToken.java index dd0e0ac0ef..a3ff108c75 100644 --- a/cas/src/main/java/org/springframework/security/cas/authentication/CasAuthenticationToken.java +++ b/cas/src/main/java/org/springframework/security/cas/authentication/CasAuthenticationToken.java @@ -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); diff --git a/core/src/main/java/org/springframework/security/access/intercept/RunAsUserToken.java b/core/src/main/java/org/springframework/security/access/intercept/RunAsUserToken.java index 8880f6427b..379ef73805 100644 --- a/core/src/main/java/org/springframework/security/access/intercept/RunAsUserToken.java +++ b/core/src/main/java/org/springframework/security/access/intercept/RunAsUserToken.java @@ -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(); diff --git a/core/src/main/java/org/springframework/security/authentication/AuthenticationDetails.java b/core/src/main/java/org/springframework/security/authentication/AuthenticationDetails.java index 878c210a84..252d4d027d 100755 --- a/core/src/main/java/org/springframework/security/authentication/AuthenticationDetails.java +++ b/core/src/main/java/org/springframework/security/authentication/AuthenticationDetails.java @@ -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()); diff --git a/core/src/main/java/org/springframework/security/core/authority/GrantedAuthoritiesContainerImpl.java b/core/src/main/java/org/springframework/security/core/authority/GrantedAuthoritiesContainerImpl.java index 340ea40ad2..bb898a9d1c 100644 --- a/core/src/main/java/org/springframework/security/core/authority/GrantedAuthoritiesContainerImpl.java +++ b/core/src/main/java/org/springframework/security/core/authority/GrantedAuthoritiesContainerImpl.java @@ -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(); } diff --git a/core/src/main/java/org/springframework/security/core/context/SecurityContextImpl.java b/core/src/main/java/org/springframework/security/core/context/SecurityContextImpl.java index 14efc9390b..036fd81412 100644 --- a/core/src/main/java/org/springframework/security/core/context/SecurityContextImpl.java +++ b/core/src/main/java/org/springframework/security/core/context/SecurityContextImpl.java @@ -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) { diff --git a/core/src/main/java/org/springframework/security/core/token/KeyBasedPersistenceTokenService.java b/core/src/main/java/org/springframework/security/core/token/KeyBasedPersistenceTokenService.java index f07ba572e7..7fe62add2b 100644 --- a/core/src/main/java/org/springframework/security/core/token/KeyBasedPersistenceTokenService.java +++ b/core/src/main/java/org/springframework/security/core/token/KeyBasedPersistenceTokenService.java @@ -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(":"); diff --git a/ldap/src/main/java/org/springframework/security/ldap/SpringSecurityLdapTemplate.java b/ldap/src/main/java/org/springframework/security/ldap/SpringSecurityLdapTemplate.java index b611a21231..48d3b201e5 100644 --- a/ldap/src/main/java/org/springframework/security/ldap/SpringSecurityLdapTemplate.java +++ b/ldap/src/main/java/org/springframework/security/ldap/SpringSecurityLdapTemplate.java @@ -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(","); diff --git a/ldap/src/main/java/org/springframework/security/ldap/search/FilterBasedLdapUserSearch.java b/ldap/src/main/java/org/springframework/security/ldap/search/FilterBasedLdapUserSearch.java index 5f04faba47..4499e68970 100644 --- a/ldap/src/main/java/org/springframework/security/ldap/search/FilterBasedLdapUserSearch.java +++ b/ldap/src/main/java/org/springframework/security/ldap/search/FilterBasedLdapUserSearch.java @@ -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("'"); diff --git a/samples/contacts/src/main/java/sample/contact/Contact.java b/samples/contacts/src/main/java/sample/contact/Contact.java index 2e028bff39..d96fb36057 100644 --- a/samples/contacts/src/main/java/sample/contact/Contact.java +++ b/samples/contacts/src/main/java/sample/contact/Contact.java @@ -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() + "; "); diff --git a/samples/dms/src/main/java/sample/dms/AbstractElement.java b/samples/dms/src/main/java/sample/dms/AbstractElement.java index 1ed8ba6c5f..f406014860 100755 --- a/samples/dms/src/main/java/sample/dms/AbstractElement.java +++ b/samples/dms/src/main/java/sample/dms/AbstractElement.java @@ -70,7 +70,7 @@ public abstract class AbstractElement { currentElement = currentElement.getParent(); } - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); String lastCharacter = null; for (Iterator i = strings.iterator(); i.hasNext();) { String token = i.next(); diff --git a/sandbox/other/src/main/java/org/springframework/security/ldap/ppolicy/PasswordPolicyResponseControl.java b/sandbox/other/src/main/java/org/springframework/security/ldap/ppolicy/PasswordPolicyResponseControl.java index c75a799f8a..11dc133831 100644 --- a/sandbox/other/src/main/java/org/springframework/security/ldap/ppolicy/PasswordPolicyResponseControl.java +++ b/sandbox/other/src/main/java/org/springframework/security/ldap/ppolicy/PasswordPolicyResponseControl.java @@ -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]); diff --git a/web/src/main/java/org/springframework/security/web/FilterChainProxy.java b/web/src/main/java/org/springframework/security/web/FilterChainProxy.java index 5f104c9c22..b63e864b35 100644 --- a/web/src/main/java/org/springframework/security/web/FilterChainProxy.java +++ b/web/src/main/java/org/springframework/security/web/FilterChainProxy.java @@ -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: "); diff --git a/web/src/main/java/org/springframework/security/web/access/intercept/RequestKey.java b/web/src/main/java/org/springframework/security/web/access/intercept/RequestKey.java index 27c47b9da1..70fcaa3dda 100644 --- a/web/src/main/java/org/springframework/security/web/access/intercept/RequestKey.java +++ b/web/src/main/java/org/springframework/security/web/access/intercept/RequestKey.java @@ -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(","); diff --git a/web/src/main/java/org/springframework/security/web/authentication/WebAuthenticationDetails.java b/web/src/main/java/org/springframework/security/web/authentication/WebAuthenticationDetails.java index 8169fa07ed..126eaefabb 100644 --- a/web/src/main/java/org/springframework/security/web/authentication/WebAuthenticationDetails.java +++ b/web/src/main/java/org/springframework/security/web/authentication/WebAuthenticationDetails.java @@ -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()); diff --git a/web/src/main/java/org/springframework/security/web/authentication/preauth/PreAuthenticatedGrantedAuthoritiesAuthenticationDetails.java b/web/src/main/java/org/springframework/security/web/authentication/preauth/PreAuthenticatedGrantedAuthoritiesAuthenticationDetails.java index 84e015ce69..9e9ee3cc0b 100755 --- a/web/src/main/java/org/springframework/security/web/authentication/preauth/PreAuthenticatedGrantedAuthoritiesAuthenticationDetails.java +++ b/web/src/main/java/org/springframework/security/web/authentication/preauth/PreAuthenticatedGrantedAuthoritiesAuthenticationDetails.java @@ -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(); diff --git a/web/src/main/java/org/springframework/security/web/authentication/preauth/PreAuthenticatedGrantedAuthoritiesWebAuthenticationDetails.java b/web/src/main/java/org/springframework/security/web/authentication/preauth/PreAuthenticatedGrantedAuthoritiesWebAuthenticationDetails.java index 448f2ec883..c061867b77 100755 --- a/web/src/main/java/org/springframework/security/web/authentication/preauth/PreAuthenticatedGrantedAuthoritiesWebAuthenticationDetails.java +++ b/web/src/main/java/org/springframework/security/web/authentication/preauth/PreAuthenticatedGrantedAuthoritiesWebAuthenticationDetails.java @@ -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(); diff --git a/web/src/main/java/org/springframework/security/web/authentication/rememberme/AbstractRememberMeServices.java b/web/src/main/java/org/springframework/security/web/authentication/rememberme/AbstractRememberMeServices.java index 839237118d..50d0fd1b32 100644 --- a/web/src/main/java/org/springframework/security/web/authentication/rememberme/AbstractRememberMeServices.java +++ b/web/src/main/java/org/springframework/security/web/authentication/rememberme/AbstractRememberMeServices.java @@ -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); diff --git a/web/src/main/java/org/springframework/security/web/authentication/ui/DefaultLoginPageGeneratingFilter.java b/web/src/main/java/org/springframework/security/web/authentication/ui/DefaultLoginPageGeneratingFilter.java index effbb4e170..7f30203837 100644 --- a/web/src/main/java/org/springframework/security/web/authentication/ui/DefaultLoginPageGeneratingFilter.java +++ b/web/src/main/java/org/springframework/security/web/authentication/ui/DefaultLoginPageGeneratingFilter.java @@ -109,7 +109,7 @@ public class DefaultLoginPageGeneratingFilter extends GenericFilterBean { } } - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append("Login Page"); diff --git a/web/src/main/java/org/springframework/security/web/util/RedirectUrlBuilder.java b/web/src/main/java/org/springframework/security/web/util/RedirectUrlBuilder.java index 53748ec099..cc723fb0e5 100644 --- a/web/src/main/java/org/springframework/security/web/util/RedirectUrlBuilder.java +++ b/web/src/main/java/org/springframework/security/web/util/RedirectUrlBuilder.java @@ -52,7 +52,7 @@ public class RedirectUrlBuilder { } public String getUrl() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); Assert.notNull(scheme); Assert.notNull(serverName); diff --git a/web/src/main/java/org/springframework/security/web/util/TextEscapeUtils.java b/web/src/main/java/org/springframework/security/web/util/TextEscapeUtils.java index 5e83ea988c..289d2c734f 100644 --- a/web/src/main/java/org/springframework/security/web/util/TextEscapeUtils.java +++ b/web/src/main/java/org/springframework/security/web/util/TextEscapeUtils.java @@ -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);