Added generation of Transfer Objects from Type Definitions.
[controller.git] / opendaylight / sal / yang-prototype / code-generator / yang-model-parser-impl / src / main / java / org / opendaylight / controller / yang / model / parser / builder / impl / ModuleBuilder.java
index 51ab3639bbf4d084e15dde3dddd389d473f53e24..7cb51db6a60b3238b54c1b31355fc030282648ee 100644 (file)
@@ -528,7 +528,7 @@ public class ModuleBuilder implements Builder {
         List<String> pathToCase = new ArrayList<String>(parentPath);
         ChoiceCaseBuilder builder = new ChoiceCaseBuilder(caseName);
 
-        final ChildNodeBuilder parent = (ChildNodeBuilder) moduleNodes
+        final ChoiceBuilder parent = (ChoiceBuilder) moduleNodes
                 .get(pathToCase);
         if (parent != null) {
             if (parent instanceof AugmentationSchemaBuilder) {
@@ -538,6 +538,7 @@ public class ModuleBuilder implements Builder {
         }
 
         pathToCase.add(caseName.getLocalName());
+        addedChilds.put(pathToCase, builder);
         moduleNodes.put(pathToCase, builder);
 
         return builder;
@@ -608,13 +609,12 @@ public class ModuleBuilder implements Builder {
 
     public void addIdentityrefType(String baseString, List<String> parentPath,
             SchemaPath schemaPath) {
-        List<String> pathToIdentityref = new ArrayList<String>(parentPath);
         TypeAwareBuilder parent = (TypeAwareBuilder) moduleNodes
-                .get(pathToIdentityref);
+                .get(parentPath);
         IdentityrefTypeBuilder identityref = new IdentityrefTypeBuilder(
                 baseString, schemaPath);
         parent.setType(identityref);
-        dirtyNodes.put(pathToIdentityref, parent);
+        dirtyNodes.put(parentPath, parent);
     }
 
     public DeviationBuilder addDeviation(String targetPath,