From: Maros Marsalek Date: Fri, 20 Jun 2014 11:06:50 +0000 (+0200) Subject: BUG-944 Fix nested union types in config subsystem module attributes X-Git-Tag: release/helium~633 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=de72757ff310514e25c3a039eb75523810c207a4;hp=ceec41033ab311600969e595191a952ab4e6047d;ds=sidebyside BUG-944 Fix nested union types in config subsystem module attributes Before this patch only unions of non-union types are supported. Change-Id: If4aa0980246763b211a1c3fca0168ee84a1e75f9 Signed-off-by: Maros Marsalek --- diff --git a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/JavaAttribute.java b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/JavaAttribute.java index 5b0196cdda..fac4d57432 100644 --- a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/JavaAttribute.java +++ b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/JavaAttribute.java @@ -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); }