SSPCPP-616 - clean up concatenated string literals
[shibboleth/cpp-opensaml.git] / saml / saml2 / binding / impl / SAML2ECPEncoder.cpp
index 36c0fce..12a9b4f 100644 (file)
@@ -1,17 +1,21 @@
-/*
- *  Copyright 2001-2010 Internet2
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/**
+ * Licensed to the University Corporation for Advanced Internet
+ * Development, Inc. (UCAID) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for
+ * additional information regarding copyright ownership.
+ *
+ * UCAID licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the
+ * License at
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific
+ * language governing permissions and limitations under the License.
  */
 
 /**
@@ -55,13 +59,12 @@ namespace opensaml {
         {
         public:
             SAML2ECPEncoder(const DOMElement* e, const XMLCh* ns) : m_actor("http://schemas.xmlsoap.org/soap/actor/next"),
-                    m_providerName(e ? e->getAttributeNS(ns, ProviderName) : nullptr), m_idpList(nullptr) {
+                    m_providerName(e ? e->getAttributeNS(ns, ProviderName) : nullptr) {
                 DOMElement* child = e ? XMLHelper::getFirstChildElement(e, SAML20P_NS, IDPList::LOCAL_NAME) : nullptr;
                 if (child)
-                    m_idpList = dynamic_cast<IDPList*>(XMLObjectBuilder::buildOneFromElement(child));
+                    m_idpList.reset(dynamic_cast<IDPList*>(XMLObjectBuilder::buildOneFromElement(child)));
             }
             virtual ~SAML2ECPEncoder() {
-                delete m_idpList;
             }
 
             const XMLCh* getProtocolFamily() const {
@@ -83,7 +86,7 @@ namespace opensaml {
         private:
             auto_ptr_XMLCh m_actor;
             const XMLCh* m_providerName;
-            IDPList* m_idpList;
+            auto_ptr<IDPList> m_idpList;
             AnyElementBuilder m_anyBuilder;
         };
 
@@ -109,7 +112,7 @@ long SAML2ECPEncoder::encode(
 #ifdef _DEBUG
     xmltooling::NDC ndc("encode");
 #endif
-    Category& log = Category::getInstance(SAML_LOGCAT".MessageEncoder.SAML2ECP");
+    Category& log = Category::getInstance(SAML_LOGCAT ".MessageEncoder.SAML2ECP");
 
     log.debug("validating input");
     if (xmlObject->getParent())
@@ -172,7 +175,7 @@ long SAML2ECPEncoder::encode(
         hdrblock->getUnknownXMLObjects().push_back(request->getIssuer()->clone());
         if (request->getScoping() && request->getScoping()->getIDPList())
             hdrblock->getUnknownXMLObjects().push_back(request->getScoping()->getIDPList()->clone());
-        else if (m_idpList)
+        else if (m_idpList.get())
             hdrblock->getUnknownXMLObjects().push_back(m_idpList->clone());
         header->getUnknownXMLObjects().push_back(hdrblock);
     }