[java-opensaml COMMIT] /trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/common/binding/SAMLBindingSupport.java

noreply at shibboleth.net noreply at shibboleth.net
Mon Jan 6 12:12:46 EST 2014


Author: scantor
Date: Mon Jan  6 12:12:46 2014
New Revision: 3548

URL: http://svn.shibboleth.net/view/java-opensaml?rev=3548&view=rev
Log:
Change unchecked exceptions to managed.

Modified:
    trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/common/binding/SAMLBindingSupport.java

Modified: trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/common/binding/SAMLBindingSupport.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/common/binding/SAMLBindingSupport.java?rev=3548&r1=3547&r2=3548&view=diff
==============================================================================
--- trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/common/binding/SAMLBindingSupport.java (original)
+++ trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/common/binding/SAMLBindingSupport.java Mon Jan  6 12:12:46 2014
@@ -111,17 +111,21 @@
     @Nonnull public static URI getEndpointURL(@Nonnull final MessageContext<SAMLObject> messageContext) 
             throws BindingException {
         final SAMLPeerEntityContext peerContext = messageContext.getSubcontext(SAMLPeerEntityContext.class, false);
-        Constraint.isNotNull(peerContext, "Message context contained no PeerEntityContext");
+        if (peerContext == null) {
+            throw new BindingException("Message context contained no PeerEntityContext");
+        }
+        
         final SAMLEndpointContext endpointContext = peerContext.getSubcontext(SAMLEndpointContext.class, false);
-        Constraint.isNotNull(endpointContext, "PeerEntityContext contained no SAMLEndpointContext");
+        if (endpointContext == null) {
+            throw new BindingException("PeerEntityContext contained no SAMLEndpointContext");
+        }
         
         final Endpoint endpoint = endpointContext.getEndpoint();
-        
         if (endpoint == null) {
             throw new BindingException("Endpoint for relying party was null.");
         }
 
-        SAMLObject message = messageContext.getMessage();
+        final SAMLObject message = messageContext.getMessage();
         if ((message instanceof org.opensaml.saml.saml2.core.StatusResponseType 
                 || message instanceof org.opensaml.saml.saml1.core.Response) 
                 && !Strings.isNullOrEmpty(endpoint.getResponseLocation())) {



More information about the commits mailing list