Merge "Do not force toString() in NetconfClientSession"
[controller.git] / opendaylight / netconf / netconf-util / src / main / java / org / opendaylight / controller / netconf / util / messages / NetconfMessageUtil.java
index 49395d53d21225a20b6d47491db0e05fd03626eb..61b23202c3a134c27d975279e2f29f7d7eefefa0 100644 (file)
@@ -10,21 +10,20 @@ package org.opendaylight.controller.netconf.util.messages;
 
 import com.google.common.base.Function;
 import com.google.common.collect.Collections2;
+import java.util.Collection;
+import java.util.List;
+import javax.annotation.Nonnull;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.api.NetconfMessage;
+import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.controller.netconf.util.xml.XmlElement;
-import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 
-import javax.annotation.Nullable;
-import java.util.Collection;
-import java.util.List;
-
 public final class NetconfMessageUtil {
 
-    private static final Logger logger = LoggerFactory.getLogger(NetconfMessageUtil.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfMessageUtil.class);
 
     private NetconfMessageUtil() {}
 
@@ -65,14 +64,13 @@ public final class NetconfMessageUtil {
         List<XmlElement> caps = capabilitiesElement.getChildElements(XmlNetconfConstants.CAPABILITY);
         return Collections2.transform(caps, new Function<XmlElement, String>() {
 
-            @Nullable
             @Override
-            public String apply(@Nullable XmlElement input) {
+            public String apply(@Nonnull XmlElement input) {
                 // Trim possible leading/tailing whitespace
                 try {
                     return input.getTextContent().trim();
                 } catch (NetconfDocumentedException e) {
-                    logger.trace("Error fetching inpit text content becauese {}",e);
+                    LOG.trace("Error fetching input text content",e);
                     return null;
                 }
             }