<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:53:32 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>[YANGTOOLS-535] NPE when reading an object generated from a choice statement</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-535</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;Trying to get an object generated from a choice statement including both leaf and container results in a NPE. I&apos;m not 100% sure that the NPE is caused by the combination of leaf and container, but there it is.  The model used resembles the following:&lt;/p&gt;

&lt;p&gt;grouping object {&lt;br/&gt;
  choice type {&lt;br/&gt;
    leaf simple-type &lt;/p&gt;
{
      type int;
    }
&lt;p&gt;    container complex-type &lt;/p&gt;
{
      uses some-grouping;
    }
&lt;p&gt;  }&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;Real version at &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;.&lt;/p&gt;

&lt;p&gt;The object grouping is used as the input for an RPC.  When trying to call RPCInput.getObject().getType() the NPE is thrown.  Same result if the grouping is used for RESTCONF input, when reading the generated objects.  Here are the relevant first few lines (based on the real model):&lt;/p&gt;

&lt;p&gt;java.lang.NullPointerException&lt;br/&gt;
    at org.opendaylight.yangtools.binding.data.codec.impl.ChoiceNodeCodecContext.deserialize(ChoiceNodeCodecContext.java:157)&lt;br/&gt;
    at org.opendaylight.yangtools.binding.data.codec.impl.ChoiceNodeCodecContext.deserializeObject(ChoiceNodeCodecContext.java:169)&lt;br/&gt;
    at org.opendaylight.yangtools.binding.data.codec.impl.DataObjectCodecContext.getBindingChildValue(DataObjectCodecContext.java:329)&lt;br/&gt;
    at org.opendaylight.yangtools.binding.data.codec.impl.LazyDataObject.getBindingData(LazyDataObject.java:122)&lt;br/&gt;
    at org.opendaylight.yangtools.binding.data.codec.impl.LazyDataObject.invoke(LazyDataObject.java:69)&lt;br/&gt;
    at com.sun.proxy.$Proxy81.getAddress(Unknown Source)&lt;br/&gt;
    at org.opendaylight.lispflowmapping.implementation.MappingService.addKey(MappingService.java:140)&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; &lt;a href=&quot;https://git.opendaylight.org/gerrit/gitweb?p=lispflowmapping.git;a=blob;f=mappingservice/lisp-proto/src/main/yang/lisp-address-types.yang;h=a2ba43c8eb669e1f1bd52e14772ea546392c1909;hb=refs/heads/topic/ietf_yang&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/gitweb?p=lispflowmapping.git;a=blob;f=mappingservice/lisp-proto/src/main/yang/lisp-address-types.yang;h=a2ba43c8eb669e1f1bd52e14772ea546392c1909;hb=refs/heads/topic/ietf_yang&lt;/a&gt;&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="22955">YANGTOOLS-535</key>
            <summary>NPE when reading an object generated from a choice statement</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                                <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="-1">Unassigned</assignee>
                                    <reporter username="ljakab">Lori Jakab</reporter>
                        <labels>
                    </labels>
                <created>Fri, 23 Oct 2015 15:58:13 +0000</created>
                <updated>Sun, 10 Apr 2022 18:35:40 +0000</updated>
                            <resolved>Wed, 28 Oct 2015 12:01:16 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="43613" author="vrpolak" created="Fri, 23 Oct 2015 16:21:19 +0000"  >&lt;p&gt;Is this just another symptom of &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-524&quot; title=&quot;Shorthand case statement not working&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-524&quot;&gt;&lt;del&gt;YANGTOOLS-524&lt;/del&gt;&lt;/a&gt;?&lt;/p&gt;</comment>
                            <comment id="43614" author="ljakab" created="Fri, 23 Oct 2015 16:23:07 +0000"  >&lt;p&gt;I will check if the proposed fix for &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-524&quot; title=&quot;Shorthand case statement not working&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-524&quot;&gt;&lt;del&gt;YANGTOOLS-524&lt;/del&gt;&lt;/a&gt; helps.&lt;/p&gt;</comment>
                            <comment id="43615" author="martin.ciglan" created="Wed, 28 Oct 2015 08:15:43 +0000"  >&lt;p&gt;Hi&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-524&quot; title=&quot;Shorthand case statement not working&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-524&quot;&gt;&lt;del&gt;YANGTOOLS-524&lt;/del&gt;&lt;/a&gt; was merged to master, can you try it again, please?&lt;/p&gt;</comment>
                            <comment id="43616" author="ljakab" created="Wed, 28 Oct 2015 11:49:20 +0000"  >&lt;p&gt;I just checked, the issue is now fixed.&lt;/p&gt;

&lt;p&gt;The problem was not mixing leaves and containers under `choice`, but rather the lack of a `case` statement for each choice, because by adding a `case` statement also fixed the issue.&lt;/p&gt;

&lt;p&gt;But now it works without the `case` statement too.&lt;/p&gt;</comment>
                            <comment id="43617" author="martin.ciglan" created="Wed, 28 Oct 2015 12:01:16 +0000"  >&lt;p&gt;real issue was case-shorthand stated in GROUPING.&lt;/p&gt;

&lt;p&gt;Glad to hear it works. Thank you.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </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_10208" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>External issue ID</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4520</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10201" key="com.atlassian.jira.plugin.system.customfieldtypes:url">
                        <customfieldname>External issue URL</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[https://bugs.opendaylight.org/show_bug.cgi?id=4520]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10206" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Issue Type</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10300"><![CDATA[Bug]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10204" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>ODL SR Target Milestone</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10351"><![CDATA[Beryllium-M5]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i027tr:</customfieldvalue>

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