<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:52:59 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-359] NoSuchElementException during java binding generation from yang model with choice in module body at top level</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-359</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;BindingGeneratorImpl fails during java source code generation from yang model witch contains choice element directly in module body at top level.&lt;/p&gt;

&lt;p&gt;For an example:&lt;br/&gt;
module choice-test {&lt;br/&gt;
    yang-version 1;&lt;br/&gt;
    namespace &quot;uri:choice-test&quot;;&lt;br/&gt;
    prefix tst;&lt;/p&gt;

&lt;p&gt;    revision 2014-10-07 &lt;/p&gt;
{
        description
                &quot;Choice test.&quot;;
    }

&lt;p&gt;    choice my-choice {&lt;br/&gt;
        case one {&lt;br/&gt;
            leaf my-choice-leaf-one &lt;/p&gt;
{
                type string;
            }
&lt;p&gt;        }&lt;br/&gt;
        case two {&lt;br/&gt;
            leaf my-choice-leaf-two &lt;/p&gt;
{
                type int16;
            }
&lt;p&gt;        }&lt;br/&gt;
    }&lt;br/&gt;
}&lt;/p&gt;


&lt;p&gt;This is because the line 1213 and 1214 in BindingGeneratorImpl.java class:&lt;br/&gt;
final SchemaPath nodeSp = choiceNode.getPath();&lt;br/&gt;
final Object parentNode = findDataSchemaNode(schemaContext, nodeSp.getParent());&lt;/p&gt;

&lt;p&gt;The parent path of choice element is empty (because parent is module) and therefore iterator.next() on the path fails.&lt;/p&gt;

&lt;p&gt;Exception stack trace:&lt;br/&gt;
 Unable to generate sources with org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl generator&lt;br/&gt;
java.util.NoSuchElementException&lt;br/&gt;
	at com.google.common.collect.Iterators$1.next(Iterators.java:71)&lt;br/&gt;
	at org.opendaylight.yangtools.yang.model.util.SchemaContextUtil.findNodeInSchemaContext(SchemaContextUtil.java:252)&lt;br/&gt;
	at org.opendaylight.yangtools.yang.model.util.SchemaContextUtil.findDataSchemaNode(SchemaContextUtil.java:83)&lt;br/&gt;
	at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.generateTypesFromChoiceCases(BindingGeneratorImpl.java:1215)&lt;br/&gt;
	at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.choiceToGeneratedType(BindingGeneratorImpl.java:1161)&lt;br/&gt;
	at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.addSchemaNodeToBuilderAsMethod(BindingGeneratorImpl.java:1117)&lt;br/&gt;
	at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.resolveDataSchemaNodes(BindingGeneratorImpl.java:1046)&lt;br/&gt;
	at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.moduleToGenTypes(BindingGeneratorImpl.java:268)&lt;br/&gt;
	at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.generateTypes(BindingGeneratorImpl.java:237)&lt;br/&gt;
	at org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl.generateSources(CodeGeneratorImpl.java:62)&lt;/p&gt;

&lt;p&gt;  ....&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="22779">YANGTOOLS-359</key>
            <summary>NoSuchElementException during java binding generation from yang model with choice in module body at top level</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="pkajsa">Peter Kajsa</assignee>
                                    <reporter username="pkajsa">Peter Kajsa</reporter>
                        <labels>
                    </labels>
                <created>Thu, 6 Nov 2014 14:16:09 +0000</created>
                <updated>Sun, 10 Apr 2022 18:35:24 +0000</updated>
                            <resolved>Thu, 7 May 2015 09:36:42 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="43153" author="pkajsa" created="Thu, 13 Nov 2014 14:10:47 +0000"  >&lt;p&gt;fix: &lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/12813/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/12813/&lt;/a&gt;&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>2333</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=2333]]></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="10361"><![CDATA[Lithium-RC0]]></customfieldvalue>

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

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