BUG-944 Fix nested union types in config subsystem module attributes
[controller.git] / 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);
             }