Remove use of SLF4j MessageFormatter whose API changes in 1.6
authorlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Mon, 23 Aug 2010 13:56:06 +0000 (13:56 +0000)
committerlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Mon, 23 Aug 2010 13:56:06 +0000 (13:56 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/branches/REL_2@2943 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/main/java/edu/internet2/middleware/shibboleth/idp/authn/AuthenticationEngine.java
src/main/java/edu/internet2/middleware/shibboleth/idp/authn/provider/IPAddressLoginHandler.java
src/main/java/edu/internet2/middleware/shibboleth/idp/profile/AbstractSAMLProfileHandler.java
src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml1/AbstractSAML1ProfileHandler.java
src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml1/ArtifactResolution.java
src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml1/ShibbolethSSOProfileHandler.java
src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/AbstractSAML2ProfileHandler.java
src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/AttributeQueryProfileHandler.java
src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SSOProfileHandler.java

index 9318a68..50945a0 100644 (file)
@@ -41,7 +41,6 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import org.joda.time.DateTime;
-import org.joda.time.chrono.ISOChronology;
 import org.opensaml.saml2.core.AuthnContext;
 import org.opensaml.util.URLBuilder;
 import org.opensaml.util.storage.StorageService;
@@ -50,7 +49,6 @@ import org.opensaml.xml.util.Base64;
 import org.opensaml.xml.util.DatatypeHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.slf4j.helpers.MessageFormatter;
 
 import edu.internet2.middleware.shibboleth.common.session.SessionManager;
 import edu.internet2.middleware.shibboleth.common.util.HttpHelper;
@@ -300,7 +298,9 @@ public class AuthenticationEngine extends HttpServlet {
                 supportedLoginHandlerEntry = supportedLoginHandlerItr.next();
                 if (!supportedLoginHandlerEntry.getKey().equals(AuthnContext.PREVIOUS_SESSION_AUTHN_CTX)
                         && !requestedMethods.contains(supportedLoginHandlerEntry.getKey())) {
-                    LOG.debug("Filtering out login handler for authentication {}, it does not provide a requested authentication method",
+                    LOG
+                            .debug(
+                                    "Filtering out login handler for authentication {}, it does not provide a requested authentication method",
                                     supportedLoginHandlerEntry.getKey());
                     supportedLoginHandlerItr.remove();
                 }
@@ -320,20 +320,20 @@ public class AuthenticationEngine extends HttpServlet {
     }
 
     /**
-     * Filters out the previous session login handler if there is no existing IdP session, no active authentication 
-     * methods, or if at least one of the active authentication methods do not match the requested authentication 
+     * Filters out the previous session login handler if there is no existing IdP session, no active authentication
+     * methods, or if at least one of the active authentication methods do not match the requested authentication
      * methods.
      * 
      * @param supportedLoginHandlers login handlers supported by the authentication engine for this request, never null
      * @param idpSession current IdP session, may be null if no session currently exists
      * @param loginContext current login context, never null
      */
-    protected void filterPreviousSessionLoginHandler(Map<String, LoginHandler> supportedLoginHandlers, 
+    protected void filterPreviousSessionLoginHandler(Map<String, LoginHandler> supportedLoginHandlers,
             Session idpSession, LoginContext loginContext) {
-        if(!supportedLoginHandlers.containsKey(AuthnContext.PREVIOUS_SESSION_AUTHN_CTX)){
+        if (!supportedLoginHandlers.containsKey(AuthnContext.PREVIOUS_SESSION_AUTHN_CTX)) {
             return;
         }
-        
+
         if (idpSession == null) {
             LOG.debug("Filtering out previous session login handler because there is no existing IdP session");
             supportedLoginHandlers.remove(AuthnContext.PREVIOUS_SESSION_AUTHN_CTX);
@@ -350,7 +350,8 @@ public class AuthenticationEngine extends HttpServlet {
             }
         }
         if (currentAuthnMethods.isEmpty()) {
-            LOG.debug("Filtering out previous session login handler because there are no active authentication methods");
+            LOG
+                    .debug("Filtering out previous session login handler because there are no active authentication methods");
             supportedLoginHandlers.remove(AuthnContext.PREVIOUS_SESSION_AUTHN_CTX);
             return;
         }
@@ -367,7 +368,8 @@ public class AuthenticationEngine extends HttpServlet {
             }
 
             if (!retainPreviousSession) {
-                LOG.debug("Filtering out previous session login handler, no active authentication methods match required methods");
+                LOG
+                        .debug("Filtering out previous session login handler, no active authentication methods match required methods");
                 supportedLoginHandlers.remove(AuthnContext.PREVIOUS_SESSION_AUTHN_CTX);
                 return;
             }
@@ -402,7 +404,8 @@ public class AuthenticationEngine extends HttpServlet {
             loginHandler = loginHandlers.get(activeMethod.getAuthenticationMethod());
             if (loginHandler != null && !loginHandler.supportsForceAuthentication()) {
                 for (String handlerSupportedMethods : loginHandler.getSupportedAuthenticationMethods()) {
-                    LOG.debug("Removing LoginHandler {}, it does not support forced re-authentication", loginHandler.getClass().getName());
+                    LOG.debug("Removing LoginHandler {}, it does not support forced re-authentication", loginHandler
+                            .getClass().getName());
                     loginHandlers.remove(handlerSupportedMethods);
                 }
             }
@@ -453,7 +456,6 @@ public class AuthenticationEngine extends HttpServlet {
         }
     }
 
-
     /**
      * Selects a login handler from a list of possible login handlers that could be used for the request.
      * 
@@ -489,12 +491,12 @@ public class AuthenticationEngine extends HttpServlet {
                 }
             }
         }
-//            possibleLoginHandlers.remove(AuthnContext.PREVIOUS_SESSION_AUTHN_CTX);
-//            if (possibleLoginHandlers.isEmpty()) {
-//                LOG.info("No authentication mechanism available for use with relying party '{}'", loginContext
-//                        .getRelyingPartyId());
-//                throw new AuthenticationException();
-//            }
+        // possibleLoginHandlers.remove(AuthnContext.PREVIOUS_SESSION_AUTHN_CTX);
+        // if (possibleLoginHandlers.isEmpty()) {
+        // LOG.info("No authentication mechanism available for use with relying party '{}'", loginContext
+        // .getRelyingPartyId());
+        // throw new AuthenticationException();
+        // }
 
         if (loginContext.getDefaultAuthenticationMethod() != null
                 && possibleLoginHandlers.containsKey(loginContext.getDefaultAuthenticationMethod())) {
@@ -535,10 +537,9 @@ public class AuthenticationEngine extends HttpServlet {
             if (actualAuthnMethod != null) {
                 if (!loginContext.getRequestedAuthenticationMethods().isEmpty()
                         && !loginContext.getRequestedAuthenticationMethods().contains(actualAuthnMethod)) {
-                    String msg = MessageFormatter
-                            .format(
-                                    "Relying patry required an authentication method of '{}' but the login handler performed '{}'",
-                                    loginContext.getRequestedAuthenticationMethods(), actualAuthnMethod);
+                    String msg = "Relying patry required an authentication method of "
+                            + loginContext.getRequestedAuthenticationMethods() + " but the login handler performed "
+                            + actualAuthnMethod;
                     LOG.error(msg);
                     throw new AuthenticationException(msg);
                 }
index b529e7b..9691e56 100644 (file)
@@ -27,7 +27,6 @@ import javax.servlet.http.HttpServletResponse;
 import org.opensaml.xml.util.DatatypeHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.slf4j.helpers.MessageFormatter;
 
 import edu.internet2.middleware.shibboleth.idp.authn.AuthenticationEngine;
 import edu.internet2.middleware.shibboleth.idp.authn.LoginHandler;
@@ -91,8 +90,7 @@ public class IPAddressLoginHandler extends AbstractLoginHandler {
                         "Client failed IP address authentication");
             }
         } catch (UnknownHostException e) {
-            String msg = MessageFormatter.format("Unable to resolve {} in to an IP address", httpRequest
-                    .getRemoteAddr());
+            String msg = "Unable to resolve " + httpRequest.getRemoteAddr() + " in to an IP address";
             log.warn(msg);
             httpRequest.setAttribute(LoginHandler.AUTHENTICATION_ERROR_KEY, msg);
         }
index 70e1d3a..ad7c032 100644 (file)
@@ -473,11 +473,9 @@ public abstract class AbstractSAMLProfileHandler extends
     protected <T extends SAMLNameIdentifierEncoder> Pair<BaseAttribute, T> selectNameIDAttributeAndEncoderByRequiredFormat(
             String requiredNameFormat, Class<T> nameIdEncoderType, BaseSAMLProfileRequestContext requestContext)
             throws ProfileException {
-        String requiredNameFormatErr = MessageFormatter.format(
-                "No attribute of principal '{}' can be encoded in to a NameIdentifier of "
-                        + "required format '{}' for relying party '{}'", new Object[] {
-                        requestContext.getPrincipalName(), requiredNameFormat,
-                        requestContext.getInboundMessageIssuer(), });
+        String requiredNameFormatErr = "No attribute of principal '" + requestContext.getPrincipalName()
+                + "' can be encoded in to a NameIdentifier of " + "required format '" + requiredNameFormat
+                + "' for relying party '" + requestContext.getInboundMessageIssuer() + "'";
 
         Map<String, BaseAttribute> principalAttributes = requestContext.getAttributes();
         if (principalAttributes == null || principalAttributes.isEmpty()) {
@@ -582,7 +580,9 @@ public abstract class AbstractSAMLProfileHandler extends
         nameIdAttributeAndEncoder = selectNameIDAttributeAndEncoder(nameIdEncoderType, principalAttributes,
                 supportedNameFormats);
         if (nameIdAttributeAndEncoder == null) {
-            log.debug( "No attributes for principal '{}' support encoding into a supported name identifier format for relying party '{}'",
+            log
+                    .debug(
+                            "No attributes for principal '{}' support encoding into a supported name identifier format for relying party '{}'",
                             requestContext.getPrincipalName(), requestContext.getInboundMessageIssuer());
         }
 
index bbc8ead..a626398 100644 (file)
@@ -60,7 +60,6 @@ import org.opensaml.xml.signature.Signer;
 import org.opensaml.xml.util.Pair;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.slf4j.helpers.MessageFormatter;
 
 import edu.internet2.middleware.shibboleth.common.attribute.AttributeRequestException;
 import edu.internet2.middleware.shibboleth.common.attribute.BaseAttribute;
@@ -368,8 +367,8 @@ public abstract class AbstractSAML1ProfileHandler extends AbstractSAMLProfileHan
                     "Required NameIdentifier format not supported"));
             throw e;
         }
-        
-        if(nameIdAttributeAndEncoder == null){
+
+        if (nameIdAttributeAndEncoder == null) {
             return null;
         }
 
@@ -387,8 +386,8 @@ public abstract class AbstractSAML1ProfileHandler extends AbstractSAMLProfileHan
             return nameId;
         } catch (AttributeEncodingException e) {
             requestContext.setFailureStatus(buildStatus(StatusCode.RESPONDER, null, "Unable to encode NameIdentifier"));
-            String msg = MessageFormatter.format("Unable to encode NameIdentifier for relying party '{}'",
-                    requestContext.getInboundMessageIssuer());
+            String msg = "Unable to encode NameIdentifier for relying party "
+                    + requestContext.getInboundMessageIssuer();
             log.error(msg, e);
             throw new ProfileException(msg, e);
         }
@@ -525,8 +524,7 @@ public abstract class AbstractSAML1ProfileHandler extends AbstractSAMLProfileHan
             return statment;
         } catch (AttributeRequestException e) {
             requestContext.setFailureStatus(buildStatus(StatusCode.RESPONDER, null, "Error resolving attributes"));
-            String msg = MessageFormatter.format("Error encoding attributes for principal '{}'", requestContext
-                    .getPrincipalName());
+            String msg = "Error encoding attributes for principal " + requestContext.getPrincipalName();
             log.error(msg, e);
             throw new ProfileException(msg, e);
         }
@@ -552,9 +550,8 @@ public abstract class AbstractSAML1ProfileHandler extends AbstractSAMLProfileHan
         } catch (AttributeRequestException e) {
             requestContext.setFailureStatus(buildStatus(StatusCode.RESPONDER, StatusCode.REQUEST_DENIED,
                     "Error resolving principal"));
-            String msg = MessageFormatter.arrayFormat(
-                    "Error resolving principal name for SAML request from relying party '{}'. Cause: {}", new Object[] {
-                            requestContext.getInboundMessageIssuer(), e.getMessage() });
+            String msg = "Error resolving principal name for SAML request from relying party '"
+                    + requestContext.getInboundMessageIssuer() + "'. Cause: " + e.getMessage();
             log.warn(msg);
             throw new ProfileException(msg, e);
         }
@@ -591,9 +588,8 @@ public abstract class AbstractSAML1ProfileHandler extends AbstractSAMLProfileHan
         }
 
         if (signatureCredential == null) {
-            String msg = MessageFormatter.format(
-                    "No signing credential is specified for relying party configuration '{}'", requestContext
-                            .getRelyingPartyConfiguration().getProviderId());
+            String msg = "No signing credential is specified for relying party configuration "
+                    + requestContext.getRelyingPartyConfiguration().getProviderId();
             log.warn(msg);
             throw new ProfileException(msg);
         }
index 470b10d..2069733 100644 (file)
@@ -47,7 +47,6 @@ import org.opensaml.ws.transport.http.HTTPOutTransport;
 import org.opensaml.xml.security.SecurityException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.slf4j.helpers.MessageFormatter;
 
 import edu.internet2.middleware.shibboleth.common.profile.ProfileException;
 import edu.internet2.middleware.shibboleth.common.profile.provider.BaseSAMLProfileRequestContext;
@@ -97,9 +96,8 @@ public class ArtifactResolution extends AbstractSAML1ProfileHandler {
 
         try {
             if (requestContext.getProfileConfiguration() == null) {
-                String msg = MessageFormatter.format(
-                        "SAML 1 Artifact resolution profile is not configured for relying party '{}'", requestContext
-                                .getInboundMessageIssuer());
+                String msg = "SAML 1 Artifact resolution profile is not configured for relying party "
+                        + requestContext.getInboundMessageIssuer();
                 requestContext.setFailureStatus(buildStatus(StatusCode.SUCCESS, StatusCode.REQUEST_DENIED, msg));
                 log.warn(msg);
                 throw new ProfileException(msg);
@@ -135,8 +133,8 @@ public class ArtifactResolution extends AbstractSAML1ProfileHandler {
     protected void decodeRequest(ArtifactResolutionRequestContext requestContext, HTTPInTransport inTransport,
             HTTPOutTransport outTransport) throws ProfileException {
         if (log.isDebugEnabled()) {
-            log.debug("Decoding message with decoder binding '{}'",
-                    getInboundMessageDecoder(requestContext).getBindingURI());
+            log.debug("Decoding message with decoder binding '{}'", getInboundMessageDecoder(requestContext)
+                    .getBindingURI());
         }
 
         requestContext.setCommunicationProfileId(getProfileId());
@@ -243,8 +241,8 @@ public class ArtifactResolution extends AbstractSAML1ProfileHandler {
         List<AssertionArtifact> assertionArtifacts = request.getAssertionArtifacts();
 
         if (assertionArtifacts == null || assertionArtifacts.size() == 0) {
-            String msg = MessageFormatter.format("No AssertionArtifacts available in request from relying party '{}'",
-                    requestContext.getInboundMessageIssuer());
+            String msg = "No AssertionArtifacts available in request from relying party "
+                    + requestContext.getInboundMessageIssuer();
             log.warn(msg);
             throw new ProfileException(msg);
         }
index ab4669f..ba15637 100644 (file)
@@ -49,7 +49,6 @@ import org.opensaml.xml.security.SecurityException;
 import org.opensaml.xml.util.DatatypeHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.slf4j.helpers.MessageFormatter;
 
 import edu.internet2.middleware.shibboleth.common.ShibbolethConstants;
 import edu.internet2.middleware.shibboleth.common.profile.ProfileException;
@@ -155,8 +154,8 @@ public class ShibbolethSSOProfileHandler extends AbstractSAML1ProfileHandler {
         loginContext.setDefaultAuthenticationMethod(rpConfig.getDefaultAuthenticationMethod());
         ProfileConfiguration ssoConfig = rpConfig.getProfileConfiguration(ShibbolethSSOConfiguration.PROFILE_ID);
         if (ssoConfig == null) {
-            String msg = MessageFormatter.format("Shibboleth SSO profile is not configured for relying party '{}'",
-                    loginContext.getRelyingPartyId());
+            String msg = "Shibboleth SSO profile is not configured for relying party "
+                    + loginContext.getRelyingPartyId();
             log.warn(msg);
             throw new ProfileException(msg);
         }
index e2fdd2f..1672171 100644 (file)
@@ -75,7 +75,6 @@ import org.opensaml.xml.util.DatatypeHelper;
 import org.opensaml.xml.util.Pair;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.slf4j.helpers.MessageFormatter;
 
 import edu.internet2.middleware.shibboleth.common.attribute.AttributeRequestException;
 import edu.internet2.middleware.shibboleth.common.attribute.BaseAttribute;
@@ -498,8 +497,7 @@ public abstract class AbstractSAML2ProfileHandler extends AbstractSAMLProfileHan
             }
         } catch (AttributeRequestException e) {
             requestContext.setFailureStatus(buildStatus(StatusCode.RESPONDER_URI, null, "Error resolving attributes"));
-            String msg = MessageFormatter.format("Error encoding attributes for principal '{}'", requestContext
-                    .getPrincipalName());
+            String msg = "Error encoding attributes for principal " + requestContext.getPrincipalName();
             log.error(msg, e);
             throw new ProfileException(msg, e);
         }
@@ -517,9 +515,8 @@ public abstract class AbstractSAML2ProfileHandler extends AbstractSAMLProfileHan
         if (profileConfiguration == null) {
             requestContext.setFailureStatus(buildStatus(StatusCode.RESPONDER_URI, StatusCode.REQUEST_DENIED_URI,
                     "Error resolving principal"));
-            String msg = MessageFormatter.format(
-                    "Unable to resolve principal, no SAML 2 profile configuration for relying party '{}'",
-                    requestContext.getInboundMessageIssuer());
+            String msg = "Unable to resolve principal, no SAML 2 profile configuration for relying party "
+                    + requestContext.getInboundMessageIssuer();
             log.warn(msg);
             throw new ProfileException(msg);
         }
@@ -533,9 +530,9 @@ public abstract class AbstractSAML2ProfileHandler extends AbstractSAMLProfileHan
         } catch (AttributeRequestException e) {
             requestContext.setFailureStatus(buildStatus(StatusCode.RESPONDER_URI, StatusCode.UNKNOWN_PRINCIPAL_URI,
                     "Error resolving principal"));
-            String msg = MessageFormatter.arrayFormat(
-                    "Error resolving principal name for SAML request '{}' from relying party '{}'. Cause: {}", new Object[]{requestContext
-                            .getInboundSAMLMessageId(), requestContext.getInboundMessageIssuer(),e.getMessage()});
+            String msg = "Error resolving principal name for SAML request '" + requestContext.getInboundSAMLMessageId()
+                    + "' from relying party '" + requestContext.getInboundMessageIssuer() + "'. Cause: "
+                    + e.getMessage();
             log.warn(msg);
             throw new ProfileException(msg, e);
         }
@@ -572,9 +569,8 @@ public abstract class AbstractSAML2ProfileHandler extends AbstractSAMLProfileHan
         }
 
         if (signatureCredential == null) {
-            String msg = MessageFormatter.format(
-                    "No signing credential is specified for relying party configuration '{}'", requestContext
-                            .getRelyingPartyConfiguration().getProviderId());
+            String msg = "No signing credential is specified for relying party configuration "
+                    + requestContext.getRelyingPartyConfiguration().getProviderId();
             log.warn(msg);
             throw new ProfileException(msg);
         }
@@ -745,9 +741,8 @@ public abstract class AbstractSAML2ProfileHandler extends AbstractSAMLProfileHan
                     || (requestContext.getProfileConfiguration().getEncryptNameID() == CryptoOperationRequirementLevel.conditional && !encoder
                             .providesMessageConfidentiality(requestContext));
         } catch (MessageEncodingException e) {
-            String msg = MessageFormatter.format(
-                    "Unable to determine if outbound encoding '{}' provides message confidentiality protection",
-                    encoder.getBindingURI());
+            String msg = "Unable to determine if outbound encoding '" + encoder.getBindingURI()
+                    + "' provides message confidentiality protection";
             log.error(msg);
             throw new ProfileException(msg);
         }
@@ -830,8 +825,8 @@ public abstract class AbstractSAML2ProfileHandler extends AbstractSAMLProfileHan
                     "Required NameID format not supported"));
             throw e;
         }
-        
-        if(nameIdAttributeAndEncoder == null){
+
+        if (nameIdAttributeAndEncoder == null) {
             return null;
         }
 
index bf9000b..3d957cf 100644 (file)
@@ -40,7 +40,6 @@ import org.opensaml.ws.transport.http.HTTPOutTransport;
 import org.opensaml.xml.security.SecurityException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.slf4j.helpers.MessageFormatter;
 
 import edu.internet2.middleware.shibboleth.common.profile.ProfileException;
 import edu.internet2.middleware.shibboleth.common.profile.provider.BaseSAMLProfileRequestContext;
@@ -80,9 +79,8 @@ public class AttributeQueryProfileHandler extends AbstractSAML2ProfileHandler {
             decodeRequest(requestContext, inTransport, outTransport);
 
             if (requestContext.getProfileConfiguration() == null) {
-                String msg = MessageFormatter.format(
-                        "SAML 2 Attribute Query profile is not configured for relying party '{}'", requestContext
-                                .getInboundMessage());
+                String msg = "SAML 2 Attribute Query profile is not configured for relying party "
+                        + requestContext.getInboundMessage();
                 requestContext.setFailureStatus(buildStatus(StatusCode.RESPONDER_URI, StatusCode.REQUEST_DENIED_URI,
                         msg));
                 log.warn(msg);
index f40880b..37191b6 100644 (file)
@@ -66,7 +66,6 @@ import org.opensaml.xml.security.SecurityException;
 import org.opensaml.xml.util.DatatypeHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.slf4j.helpers.MessageFormatter;
 import org.w3c.dom.Element;
 
 import edu.internet2.middleware.shibboleth.common.profile.ProfileException;
@@ -177,7 +176,7 @@ public class SSOProfileHandler extends AbstractSAML2ProfileHandler {
             throws ProfileException {
         HttpServletRequest httpRequest = ((HttpServletRequestAdapter) inTransport).getWrappedRequest();
         HttpServletResponse httpResponse = ((HttpServletResponseAdapter) outTransport).getWrappedResponse();
-        
+
         SSORequestContext requestContext = new SSORequestContext();
 
         try {
@@ -187,8 +186,8 @@ public class SSOProfileHandler extends AbstractSAML2ProfileHandler {
             RelyingPartyConfiguration rpConfig = getRelyingPartyConfiguration(relyingPartyId);
             ProfileConfiguration ssoConfig = rpConfig.getProfileConfiguration(getProfileId());
             if (ssoConfig == null) {
-                String msg = MessageFormatter.format("SAML 2 SSO profile is not configured for relying party '{}'",
-                        requestContext.getInboundMessageIssuer());
+                String msg = "SAML 2 SSO profile is not configured for relying party "
+                        + requestContext.getInboundMessageIssuer();
                 log.warn(msg);
                 throw new ProfileException(msg);
             }
@@ -202,7 +201,7 @@ public class SSOProfileHandler extends AbstractSAML2ProfileHandler {
 
             HttpServletHelper.bindLoginContext(loginContext, getStorageService(), httpRequest.getSession()
                     .getServletContext(), httpRequest, httpResponse);
-            
+
             URLBuilder urlBuilder = HttpServletHelper.getServletContextUrl(httpRequest);
             urlBuilder.setPath(urlBuilder.getPath() + authenticationManagerPath);
             String authnEngineUrl = urlBuilder.buildURL();
@@ -378,15 +377,13 @@ public class SSOProfileHandler extends AbstractSAML2ProfileHandler {
 
             requestContext.setFailureStatus(buildStatus(StatusCode.REQUESTER_URI, StatusCode.INVALID_NAMEID_POLICY_URI,
                     "Invalid SPNameQualifier for this request"));
-            throw new ProfileException(MessageFormatter.format(
-                    "Relying party '{}' is not a member of the affiliation '{}'", requestContext
-                            .getInboundMessageIssuer(), spNameQualifier));
+            throw new ProfileException("Relying party '" + requestContext.getInboundMessageIssuer()
+                    + "' is not a member of the affiliation " + spNameQualifier);
         } catch (MetadataProviderException e) {
             requestContext.setFailureStatus(buildStatus(StatusCode.RESPONDER_URI, null, "Internal service error"));
             log.error("Error looking up metadata for affiliation", e);
-            throw new ProfileException(MessageFormatter.format(
-                    "Relying party '{}' is not a member of the affiliation '{}'", requestContext
-                            .getInboundMessageIssuer(), spNameQualifier));
+            throw new ProfileException("Relying party '" + requestContext.getInboundMessageIssuer()
+                    + "' is not a member of the affiliation " + spNameQualifier);
         }
     }