Do not leak implementation class 72/62672/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 5 Sep 2017 08:53:50 +0000 (10:53 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 5 Sep 2017 08:53:50 +0000 (10:53 +0200)
For migration purposes we need to not leak the implementation
class from create methods. Fix them to return just the interface.

Change-Id: I801467d1a816dc1b0b1bd41ee4157c9593092544
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/yangtools/binding/data/codec/impl/BindingNormalizedNodeCodecRegistry.java

index 846e39137e73b4a5daea4f69ea96aed46c46eaf9..21ae06906fdd3ccc89a03fe8d69c7575bd81ddf8 100644 (file)
@@ -77,7 +77,7 @@ public class BindingNormalizedNodeCodecRegistry implements DataObjectSerializerR
     }
 
     public void onBindingRuntimeContextUpdated(final BindingRuntimeContext context) {
-        codecContext = create(context);
+        codecContext = new BindingCodecContext(context, this);
         generator.onBindingRuntimeContextUpdated(context);
     }
 
@@ -232,12 +232,12 @@ public class BindingNormalizedNodeCodecRegistry implements DataObjectSerializerR
     }
 
     @Override
-    public BindingCodecContext create(final BindingRuntimeContext context) {
+    public BindingCodecTree create(final BindingRuntimeContext context) {
         return new BindingCodecContext(context, this);
     }
 
     @Override
-    public BindingCodecContext create(final SchemaContext context, final Class<?>... bindingClasses) {
+    public BindingCodecTree create(final SchemaContext context, final Class<?>... bindingClasses) {
         final ModuleInfoBackedContext strategy = ModuleInfoBackedContext.create();
         for (final Class<?> bindingCls : bindingClasses) {
             try {