Clean up addYangPathArgument()
[mdsal.git] / binding / mdsal-binding-dom-codec / src / main / java / org / opendaylight / mdsal / binding / dom / codec / impl / KeyedListNodeCodecContext.java
index 2a59ae1548a69f212259f25f6a00388983bc648c..163fb812c840d5fabe710f2ff89530b05a78d636 100644 (file)
@@ -74,22 +74,20 @@ abstract sealed class KeyedListNodeCodecContext<I extends Identifier<D>, D exten
     }
 
     @Override
-    void addYangPathArgument(final InstanceIdentifier.PathArgument arg,
-            final List<YangInstanceIdentifier.PathArgument> builder) {
+    void addYangPathArgument(final List<YangInstanceIdentifier.PathArgument> builder,
+            final InstanceIdentifier.PathArgument arg) {
         /*
          * DOM Instance Identifier for list is always represent by two entries one for map and one for children. This
          * is also true for wildcarded instance identifiers
          */
-        if (builder == null) {
-            return;
-        }
+        final var yangArg = getDomPathArgument();
+        builder.add(yangArg);
 
-        super.addYangPathArgument(arg, builder);
         if (arg instanceof IdentifiableItem<?, ?> identifiable) {
             builder.add(codec.bindingToDom(identifiable));
         } else {
             // Adding wildcarded
-            super.addYangPathArgument(arg, builder);
+            builder.add(yangArg);
         }
     }