Formatted code Bug-3894. 91/30191/4
authorshivanip <shivani.pathak@tcs.com>
Fri, 11 Dec 2015 09:06:11 +0000 (14:36 +0530)
committershivanip <shivani.pathak@tcs.com>
Fri, 11 Dec 2015 10:25:18 +0000 (15:55 +0530)
Change-Id: I9cc580133250c12592e8eb2d64629c54fc3d78f0
Signed-off-by: Shivani Pathak <shivani.pathak@tcs.com>
opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/exi/NetconfStartExiMessage.java

index 5d8efa4b55ebb67a05d19f5df613bd25ed090062..7bdff44d746fb5a3304cb048dba608910bf85c3b 100644 (file)
@@ -16,6 +16,8 @@ import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
 import org.openexi.proc.common.EXIOptions;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Start-exi netconf message.
@@ -30,7 +32,7 @@ public final class NetconfStartExiMessage extends NetconfMessage {
     public static final String LEXICAL_VALUES_KEY = "lexical-values";
     public static final String PIS_KEY = "pis";
     public static final String PREFIXES_KEY = "prefixes";
-
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfStartExiMessage.class);
     private NetconfStartExiMessage(final Document doc) {
         super(doc);
     }
@@ -77,16 +79,12 @@ public final class NetconfStartExiMessage extends NetconfMessage {
         final Element alignmentElement = doc.createElementNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_EXI_1_0,
                 ALIGNMENT_KEY);
 
-        String alignmentString = EXIParameters.EXI_PARAMETER_BIT_PACKED;
+        String alignmentString;
         switch (exiOptions.getAlignmentType()) {
         case byteAligned: {
             alignmentString = EXIParameters.EXI_PARAMETER_BYTE_ALIGNED;
             break;
         }
-        case bitPacked: {
-            alignmentString = EXIParameters.EXI_PARAMETER_BIT_PACKED;
-            break;
-        }
         case compress: {
             alignmentString = EXIParameters.EXI_PARAMETER_COMPRESSED;
             break;
@@ -95,6 +93,12 @@ public final class NetconfStartExiMessage extends NetconfMessage {
             alignmentString = EXIParameters.EXI_PARAMETER_PRE_COMPRESSION;
             break;
         }
+        default:
+            LOG.warn("Unexpected value in EXI alignment type: {} , using default value", exiOptions.getAlignmentType());
+        case bitPacked: {
+            alignmentString = EXIParameters.EXI_PARAMETER_BIT_PACKED;
+            break;
+        }
         }
 
         alignmentElement.setTextContent(alignmentString);