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 5b0196cdda78d4354ab01c8cae3c156f1cfbbd64..fac4d5743229501fd7827269a8c810ac6b6f54a1 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);
             }