Remove use of NodeIdentifierWithPredicates constructors
[netconf.git] / restconf / restconf-nb-bierman02 / src / main / java / org / opendaylight / netconf / sal / restconf / impl / ControllerContext.java
index 6fbfee531f58cf90c21b566fe611740121ea33a2..5908624515f80a1a0b66695fda555236c6e78c0f 100644 (file)
@@ -957,12 +957,8 @@ public final class ControllerContext implements SchemaContextListener, Closeable
             final ListSchemaNode node, final DOMMountPoint mount) {
         final QName nodeType = argument.getNodeType();
         final CharSequence nodeIdentifier = this.toRestconfIdentifier(nodeType, mount);
-        final Map<QName, Object> keyValues = argument.getKeyValues();
 
-        final StringBuilder builder = new StringBuilder();
-        builder.append('/');
-        builder.append(nodeIdentifier);
-        builder.append('/');
+        final StringBuilder builder = new StringBuilder().append('/').append(nodeIdentifier).append('/');
 
         final List<QName> keyDefinition = node.getKeyDefinition();
         boolean hasElements = false;
@@ -975,12 +971,14 @@ public final class ControllerContext implements SchemaContextListener, Closeable
                         builder.append('/');
                     }
 
+                    Preconditions.checkState(listChild instanceof LeafSchemaNode,
+                        "List key has to consist of leaves, not %s", listChild);
+
+                    final Object value = argument.getValue(key);
                     try {
-                        Preconditions.checkState(listChild instanceof LeafSchemaNode,
-                            "List key has to consist of leaves, not %s", listChild);
-                        builder.append(toUriString(keyValues.get(key), (LeafSchemaNode)listChild, mount));
+                        builder.append(toUriString(value, (LeafSchemaNode)listChild, mount));
                     } catch (final UnsupportedEncodingException e) {
-                        LOG.error("Error parsing URI: {}", keyValues.get(key), e);
+                        LOG.error("Error parsing URI: {}", value, e);
                         return null;
                     }
                     break;