<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:10:23 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[MDSAL-647] org.opendaylight.mdsal.binding.model.ietf.rfc8776 generated classes from typedef -&gt; typedef -&gt; enumeration</title>
                <link>https://jira.opendaylight.org/browse/MDSAL-647</link>
                <project id="10137" key="MDSAL">mdsal</project>
                    <description>&lt;p&gt;In ietf-te-types yang model there is a type definition &#8220;te-common-status&#8221; which type is enumeration. This type definition is used to declare 2 another type definitions:&lt;/p&gt;


&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
  typedef te-oper-status {
    type te-common-status;
    description
      &quot;Defines a type representing the operational status of
       a TE resource.&quot;;
  }

  typedef te-admin-status {
    type te-common-status;
    description
      &quot;Defines a type representing the administrative status of
       a TE resource.&quot;;
  }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The generated classes from te-oper-status  (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.types.rev200610. TeOperStatus) and te-admin-status (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.types.rev200610. TeAdminStatus) are empty Class. Shouldn&#8217;t they be Enum instead ? I ask this question because when I try to serialize object using them I got the following exception&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
Exception in thread &lt;span class=&quot;code-quote&quot;&gt;&quot;main&quot;&lt;/span&gt; java.lang.IllegalArgumentException
            at com.google.common.base.Preconditions.checkArgument(Preconditions.java:128)
            at org.opendaylight.mdsal.binding.dom.codec.impl.EnumerationCodec.loader(EnumerationCodec.java:38)
            at org.opendaylight.mdsal.binding.dom.codec.impl.ValueTypeCodec.getCodecLoader(ValueTypeCodec.java:87)
            at org.opendaylight.mdsal.binding.dom.codec.impl.ValueTypeCodec.getCodecFor(ValueTypeCodec.java:65)
            at org.opendaylight.mdsal.binding.dom.codec.impl.BindingCodecContext.getCodecForBindingClass(BindingCodecContext.java:448)
            at org.opendaylight.mdsal.binding.dom.codec.impl.BindingCodecContext.getCodec(BindingCodecContext.java:421)
            at org.opendaylight.mdsal.binding.dom.codec.impl.BindingCodecContext.getLeafNodesUsingReflection(BindingCodecContext.java:371)
            at org.opendaylight.mdsal.binding.dom.codec.impl.BindingCodecContext.getLeafNodes(BindingCodecContext.java:356)
            at org.opendaylight.mdsal.binding.dom.codec.impl.DataObjectCodecContext.&amp;lt;init&amp;gt;(DataObjectCodecContext.java:112)
            at org.opendaylight.mdsal.binding.dom.codec.impl.DataObjectCodecContext.&amp;lt;init&amp;gt;(DataObjectCodecContext.java:104)
            at org.opendaylight.mdsal.binding.dom.codec.impl.ContainerNodeCodecContext.&amp;lt;init&amp;gt;(ContainerNodeCodecContext.java:20)
            at org.opendaylight.mdsal.binding.dom.codec.impl.DataContainerCodecPrototype.createInstance(DataContainerCodecPrototype.java:261)
            at org.opendaylight.mdsal.binding.dom.codec.impl.DataContainerCodecPrototype.loadInstance(DataContainerCodecPrototype.java:245)
            at org.opendaylight.mdsal.binding.dom.codec.impl.DataContainerCodecPrototype.get(DataContainerCodecPrototype.java:238)
            at org.opendaylight.mdsal.binding.dom.codec.impl.DataObjectCodecContext.streamChild(DataObjectCodecContext.java:266)
            at org.opendaylight.mdsal.binding.dom.codec.impl.BindingToNormalizedStreamWriter.enter(BindingToNormalizedStreamWriter.java:80)
            at org.opendaylight.mdsal.binding.dom.codec.impl.BindingToNormalizedStreamWriter.startContainerNode(BindingToNormalizedStreamWriter.java:179)
            at org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev200806.networks.network.link.Te$$$streamer.serialize(Unknown Source)
            at org.opendaylight.mdsal.binding.dom.codec.impl.DataObjectStreamer.streamContainer(DataObjectStreamer.java:90)
            at org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev200806.Link1$$$streamer.serialize(Unknown Source)
            at org.opendaylight.mdsal.binding.dom.codec.impl.BindingCodecContext$DataObjectSerializerProxy.serialize(BindingCodecContext.java:122)
            at org.opendaylight.mdsal.binding.dom.codec.impl.DataObjectStreamer.emitAugmentation(DataObjectStreamer.java:176)
            at org.opendaylight.mdsal.binding.dom.codec.impl.DataObjectStreamer.streamAugmentations(DataObjectStreamer.java:63)
            at org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.Link$$$streamer.serialize(Unknown Source)
            at org.opendaylight.mdsal.binding.dom.codec.impl.DataObjectStreamer.commonStreamList(DataObjectStreamer.java:153)
            at org.opendaylight.mdsal.binding.dom.codec.impl.DataObjectStreamer.streamMap(DataObjectStreamer.java:133)
            at org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Network1$$$streamer.serialize(Unknown Source)
            at org.opendaylight.mdsal.binding.dom.codec.impl.BindingCodecContext$DataObjectSerializerProxy.serialize(BindingCodecContext.java:122)
            at org.opendaylight.mdsal.binding.dom.codec.impl.DataObjectStreamer.emitAugmentation(DataObjectStreamer.java:176)
            at org.opendaylight.mdsal.binding.dom.codec.impl.DataObjectStreamer.streamAugmentations(DataObjectStreamer.java:63)
            at org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.Network$$$streamer.serialize(Unknown Source)
            at org.opendaylight.mdsal.binding.dom.codec.impl.DataObjectStreamer.commonStreamList(DataObjectStreamer.java:153)
            at org.opendaylight.mdsal.binding.dom.codec.impl.DataObjectStreamer.streamMap(DataObjectStreamer.java:133)
            at org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.Networks$$$streamer.serialize(Unknown Source)
            at org.opendaylight.mdsal.binding.dom.codec.impl.BindingCodecContext$DataObjectSerializerProxy.serialize(BindingCodecContext.java:122)
            at org.opendaylight.mdsal.binding.dom.codec.impl.BindingCodecContext.toNormalizedNode(BindingCodecContext.java:506)
            at org.opendaylight.mdsal.binding.dom.codec.spi.ForwardingBindingDOMCodecServices.toNormalizedNode(ForwardingBindingDOMCodecServices.java:67)
            at org.test.Serialization.serialize(Serialization.java:136)
            at org.test.Serialization.main(Serialization.java:147)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I have attached to this mail a code sample to reproduce the problem.&lt;/p&gt;</description>
                <environment></environment>
        <key id="33609">MDSAL-647</key>
            <summary>org.opendaylight.mdsal.binding.model.ietf.rfc8776 generated classes from typedef -&gt; typedef -&gt; enumeration</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.opendaylight.org/images/icons/priorities/major.svg">Medium</priority>
                        <status id="5" iconUrl="https://jira.opendaylight.org/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="rovarga">Robert Varga</assignee>
                                    <reporter username="manuedelf">Emmanuelle Delfour</reporter>
                        <labels>
                            <label>pt</label>
                    </labels>
                <created>Mon, 30 Nov 2020 17:08:15 +0000</created>
                <updated>Tue, 2 May 2023 19:43:39 +0000</updated>
                            <resolved>Tue, 2 May 2023 19:39:42 +0000</resolved>
                                                    <fixVersion>8.0.0</fixVersion>
                                    <component>Binding codegen</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="72144" author="rovarga" created="Tue, 2 May 2023 19:39:20 +0000"  >&lt;p&gt;So this is nominally a duplicate of &lt;a href=&quot;https://jira.opendaylight.org/browse/MDSAL-503&quot; title=&quot;Wrongly generated java code using derived type&quot; class=&quot;issue-link&quot; data-issue-key=&quot;MDSAL-503&quot;&gt;MDSAL-503&lt;/a&gt;, I think. This particular failure was addressed &lt;a href=&quot;https://git.opendaylight.org/gerrit/c/mdsal/+/94297&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/c/mdsal/+/94297&lt;/a&gt; by us not generating the classes anymore.&lt;/p&gt;

&lt;p&gt;This may seem counter-intuitive, but now TeCommonStatus serves both cases and its use in leaf types should result in run-time checks whether the enum satisties any restrictions on the used value.&lt;/p&gt;

&lt;p&gt;Since the enumeration maps to a java.lang.Enum, which is implicitly final, the only way we could address the non-presence of TeOperState is to push the enumeration into an inner type and have TeCommonType become a TypeObject (instead of EnumTypeObject) holding a single value.&lt;/p&gt;

&lt;p&gt;If that is a desired outcome, we can consider it in one of the major releases &amp;#8211; please file a separate issue if that is the case.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="15905" name="sample.zip" size="4454" author="manuedelf" created="Mon, 30 Nov 2020 16:57:18 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i03whj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>