Fixed bug in generating code for augment. 21/3121/1
authorMartin Vitez <mvitez@cisco.com>
Wed, 27 Nov 2013 12:00:36 +0000 (13:00 +0100)
committerMartin Vitez <mvitez@cisco.com>
Wed, 27 Nov 2013 12:00:36 +0000 (13:00 +0100)
Signed-off-by: Martin Vitez <mvitez@cisco.com>
code-generator/binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/generator/impl/BindingGeneratorImpl.xtend

index b3926169cfe725486b319f34c82a3e540f25e5cc..702dd0d7e5d0b2b87b60689e1fbdef8d76d884af 100644 (file)
@@ -882,7 +882,10 @@ public class BindingGeneratorImpl implements BindingGenerator {
             } while (result == null && !(parent instanceof Module));
 
             if (result != null) {
-                if (tmpPath.size == 1) {
+                if (tmpPath.size == 1) {\r
+                    if (result != null && result.addedByUses) {\r
+                        result = findOriginal(result);\r
+                    }
                     return result;
                 } else {
                     var DataSchemaNode newParent = result;
@@ -890,6 +893,9 @@ public class BindingGeneratorImpl implements BindingGenerator {
                     tmpPath.remove(0);
                     for (name : tmpPath) {
                         newParent = (newParent as DataNodeContainer).getDataChildByName(name);
+                    }\r
+                    if (newParent != null && newParent.addedByUses) {\r
+                        newParent = findOriginal(newParent);\r
                     }
                     return newParent;
                 }