[java-opensaml COMMIT] /trunk/opensaml-core/src/main/java/org/opensaml/core/xml/io/AbstractXMLObjectUnmarshaller.java

noreply at shibboleth.net noreply at shibboleth.net
Wed Jan 30 00:51:17 EST 2013


Author: scantor
Date: Wed Jan 30 00:51:17 2013
New Revision: 3181

URL: http://svn.shibboleth.net/view/java-opensaml?rev=3181&view=rev
Log:
Port java-xmltooling r761

Modified:
    trunk/opensaml-core/src/main/java/org/opensaml/core/xml/io/AbstractXMLObjectUnmarshaller.java

Modified: trunk/opensaml-core/src/main/java/org/opensaml/core/xml/io/AbstractXMLObjectUnmarshaller.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-core/src/main/java/org/opensaml/core/xml/io/AbstractXMLObjectUnmarshaller.java?rev=3181&r1=3180&r2=3181&view=diff
==============================================================================
--- trunk/opensaml-core/src/main/java/org/opensaml/core/xml/io/AbstractXMLObjectUnmarshaller.java (original)
+++ trunk/opensaml-core/src/main/java/org/opensaml/core/xml/io/AbstractXMLObjectUnmarshaller.java Wed Jan 30 00:51:17 2013
@@ -81,7 +81,9 @@
 
         XMLObject xmlObject = buildXMLObject(domElement);
 
-        log.trace("Unmarshalling attributes of DOM Element {}", QNameSupport.getNodeQName(domElement));
+        if (log.isTraceEnabled()) {
+            log.trace("Unmarshalling attributes of DOM Element {}", QNameSupport.getNodeQName(domElement));
+        }
         NamedNodeMap attributes = domElement.getAttributes();
         Node attribute;
         for (int i = 0; i < attributes.getLength(); i++) {
@@ -93,7 +95,9 @@
             }
         }
 
-        log.trace("Unmarshalling other child nodes of DOM Element {}", QNameSupport.getNodeQName(domElement));
+        if (log.isTraceEnabled()) {
+            log.trace("Unmarshalling other child nodes of DOM Element {}", QNameSupport.getNodeQName(domElement));
+        }
         NodeList childNodes = domElement.getChildNodes();
         Node childNode;
         for (int i = 0; i < childNodes.getLength(); i++) {
@@ -128,7 +132,9 @@
      * @throws UnmarshallingException thrown if there is now XMLObjectBuilder registered for the given DOM Element
      */
     @Nonnull protected XMLObject buildXMLObject(@Nonnull final Element domElement) throws UnmarshallingException {
-        log.trace("Building XMLObject for {}", QNameSupport.getNodeQName(domElement));
+        if (log.isTraceEnabled()) {
+            log.trace("Building XMLObject for {}", QNameSupport.getNodeQName(domElement));
+        }
         XMLObjectBuilder xmlObjectBuilder;
 
         xmlObjectBuilder = xmlObjectBuilderFactory.getBuilder(domElement);
@@ -140,8 +146,10 @@
                 log.error(errorMsg);
                 throw new UnmarshallingException(errorMsg);
             } else {
-                log.trace("No builder was registered for {} but the default builder {} was available, using it.",
-                        QNameSupport.getNodeQName(domElement), xmlObjectBuilder.getClass().getName());
+                if (log.isTraceEnabled()) {
+                    log.trace("No builder was registered for {} but the default builder {} was available, using it.",
+                            QNameSupport.getNodeQName(domElement), xmlObjectBuilder.getClass().getName());
+                }
             }
         }
 
@@ -171,8 +179,10 @@
         } else if (Objects.equal(attributeNamespace, XmlConstants.XSI_NS)) {
             unmarshallSchemaInstanceAttributes(xmlObject, attribute);
         } else {
-            log.trace("Attribute {} is neither a schema type nor namespace, calling processAttribute()",
-                    QNameSupport.getNodeQName(attribute));
+            if (log.isTraceEnabled()) {
+                log.trace("Attribute {} is neither a schema type nor namespace, calling processAttribute()",
+                        QNameSupport.getNodeQName(attribute));
+            }
             String attributeNSURI = attribute.getNamespaceURI();
             String attributeNSPrefix;
             if (attributeNSURI != null) {
@@ -196,8 +206,10 @@
      * @param attribute the namespace declaration attribute
      */
     protected void unmarshallNamespaceAttribute(@Nonnull final XMLObject xmlObject, @Nonnull final Attr attribute) {
-        log.trace("{} is a namespace declaration, adding it to the list of namespaces on the XMLObject",
-                QNameSupport.getNodeQName(attribute));
+        if (log.isTraceEnabled()) {
+            log.trace("{} is a namespace declaration, adding it to the list of namespaces on the XMLObject",
+                    QNameSupport.getNodeQName(attribute));
+        }
         Namespace namespace;
         if (Objects.equal(attribute.getLocalName(), XmlConstants.XMLNS_PREFIX)) {
             namespace = new Namespace(attribute.getValue(), null);
@@ -217,17 +229,25 @@
             @Nonnull final Attr attribute) {
         QName attribName = QNameSupport.getNodeQName(attribute);
         if (XmlConstants.XSI_TYPE_ATTRIB_NAME.equals(attribName)) {
-            log.trace("Saw XMLObject {} with an xsi:type of: {}", xmlObject.getElementQName(), attribute.getValue());
+            if (log.isTraceEnabled()) {
+                log.trace("Saw XMLObject {} with an xsi:type of: {}", xmlObject.getElementQName(), attribute.getValue());

[... 62 lines stripped ...]


More information about the commits mailing list