BUG-944 Fix nested union types in config subsystem module attributes 69/8169/2
authorMaros Marsalek <mmarsale@cisco.com>
Fri, 20 Jun 2014 11:06:50 +0000 (13:06 +0200)
committerMaros Marsalek <mmarsale@cisco.com>
Fri, 20 Jun 2014 13:14:02 +0000 (13:14 +0000)
Before this patch only unions of non-union types are supported.

Change-Id: If4aa0980246763b211a1c3fca0168ee84a1e75f9
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/JavaAttribute.java

index 5b0196c..fac4d57 100644 (file)
@@ -185,7 +185,9 @@ public class JavaAttribute extends AbstractAttribute implements TypedAttribute {
             OpenType<?> innerCompositeType;
 
             if(isDerivedType(innerTypeBaseType, innerType)) {
-                innerCompositeType = getCompositeType(innerTypeBaseType, baseInnerTypeDefinition);
+                innerCompositeType = baseInnerTypeDefinition instanceof UnionTypeDefinition ?
+                        getCompositeTypeForUnion(baseInnerTypeDefinition) :
+                        getCompositeType(innerTypeBaseType, baseInnerTypeDefinition);
             } else {
                 innerCompositeType = SimpleTypeResolver.getSimpleType(innerType);
             }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.