Serialization/Deserialization and a host of other fixes
[controller.git] / opendaylight / md-sal / sal-protocolbuffer-encoding / src / main / java / org / opendaylight / controller / cluster / datastore / node / NormalizedNodeToNodeCodec.java
index aca94359b7d44ca14fca2f733abea72d828e3c1a..fc4b3954c5b9957fd6880bc6e81f16b742d3e385 100644 (file)
@@ -37,7 +37,7 @@ public class NormalizedNodeToNodeCodec {
     public NormalizedNode<?,?> decode(YangInstanceIdentifier id, NormalizedNodeMessages.Node node){
             NodeToNormalizedNodeBuilder currentOp = NodeToNormalizedNodeBuilder.from(ctx);
 
-            for(YangInstanceIdentifier.PathArgument pathArgument : id.getPath()){
+            for(YangInstanceIdentifier.PathArgument pathArgument : id.getPathArguments()){
                 currentOp = currentOp.getChild(pathArgument);
             }
 
@@ -53,15 +53,11 @@ public class NormalizedNodeToNodeCodec {
                     nodeType = pathArgument.getNodeType();
                 }
             }
-            try {
-                if((node != null)&& (!node.getType().isEmpty())){
-                   return currentOp.normalize(nodeType, node);
-                }else{
-                  return null;
-               }
-            } catch(RuntimeException e){
-                throw e;
-        }
+            if((node != null)&& (!node.getType().isEmpty())){
+               return currentOp.normalize(nodeType, node);
+            } else{
+              return null;
+            }
     }