Migrate getDataChildByName() users
[mdsal.git] / binding / mdsal-binding-runtime-api / src / main / java / org / opendaylight / mdsal / binding / runtime / api / AbstractBindingRuntimeContext.java
index 96b5db7ab23d76644de9d85539e715fe8e80874e..8aee2609a4f600c530d2debfaa6eb6e37fa56f3e 100644 (file)
@@ -120,7 +120,7 @@ public abstract class AbstractBindingRuntimeContext implements BindingRuntimeCon
         final Set<QName> childNames = new HashSet<>();
         final Set<DataSchemaNode> realChilds = new HashSet<>();
         for (final DataSchemaNode child : origSchema.getChildNodes()) {
-            final DataSchemaNode dataChildQNname = target.getDataChildByName(child.getQName());
+            final DataSchemaNode dataChildQNname = target.dataChildByName(child.getQName());
             final String childLocalName = child.getQName().getLocalName();
             if (dataChildQNname == null) {
                 for (DataSchemaNode dataSchemaNode : target.getChildNodes()) {
@@ -235,8 +235,8 @@ public abstract class AbstractBindingRuntimeContext implements BindingRuntimeCon
     @Override
     public final ImmutableMap<AugmentationIdentifier, Type> getAvailableAugmentationTypes(
             final DataNodeContainer container) {
-        final Map<AugmentationIdentifier, Type> identifierToType = new HashMap<>();
         if (container instanceof AugmentationTarget) {
+            final Map<AugmentationIdentifier, Type> identifierToType = new HashMap<>();
             final BindingRuntimeTypes types = getTypes();
             for (final AugmentationSchemaNode augment : ((AugmentationTarget) container).getAvailableAugmentations()) {
                 // Augmentation must have child nodes if is to be used with Binding classes
@@ -252,9 +252,10 @@ public abstract class AbstractBindingRuntimeContext implements BindingRuntimeCon
                     }
                 }
             }
+            return ImmutableMap.copyOf(identifierToType);
         }
 
-        return ImmutableMap.copyOf(identifierToType);
+        return ImmutableMap.of();
     }
 
     @Override