<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:53:10 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-411] StackOverflowError for leafref</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-411</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;I want to generate JAVA classes from ietf-ospf, I hit StackOverflowError at the following definition, and the generation failed.&lt;/p&gt;


&lt;p&gt;list neighbor {&lt;br/&gt;
         description&lt;br/&gt;
           &quot;List of neighbors.&quot;;&lt;br/&gt;
         leaf neighbor-id {&lt;br/&gt;
           type leafref &lt;/p&gt;
{
             path &quot;../../neighbor/neighbor-id&quot;;
           }
&lt;p&gt;           description &quot;Neighbor.&quot;;&lt;br/&gt;
         }&lt;br/&gt;
       }&lt;/p&gt;

&lt;p&gt;If I replace path &quot;../../neighbor/neighbor-id&quot; with concrete path &quot;/rt:routing-state/rt:routing-instance/&quot;&lt;br/&gt;
               + &quot;rt:routing-protocols/rt:routing-protocol/&quot;&lt;br/&gt;
               + &quot;ospf:ospf/ospf:instance/ospf:neighbor/ospf:neighbor-id&quot;;&quot;, the error is solved.&lt;/p&gt;

&lt;p&gt;How can we solve the StackOverflowError without modifying ietf-ospf file? Could we fix it in yang-tools? Thank you!&lt;/p&gt;

&lt;p&gt;ietf-ospf.yang file is attached. Error message is:&lt;br/&gt;
java.lang.StackOverflowError&lt;br/&gt;
                at org.opendaylight.yangtools.yang.common.QName.create(QName.java:254)&lt;br/&gt;
                at org.opendaylight.yangtools.yang.model.util.SchemaContextUtil.stringPathPartToQName(SchemaContextUtil.java:513)&lt;br/&gt;
                at org.opendaylight.yangtools.yang.model.util.SchemaContextUtil.access$000(SchemaContextUtil.java:50)&lt;br/&gt;
                at org.opendaylight.yangtools.yang.model.util.SchemaContextUtil$1.apply(SchemaContextUtil.java:600)&lt;br/&gt;
                at org.opendaylight.yangtools.yang.model.util.SchemaContextUtil$1.apply(SchemaContextUtil.java:597)&lt;br/&gt;
                at com.google.common.collect.Iterators$8.transform(Iterators.java:860)&lt;br/&gt;
                at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)&lt;br/&gt;
                at com.google.common.collect.Iterators$5.next(Iterators.java:607)&lt;br/&gt;
                at com.google.common.collect.Iterables$10$1.next(Iterables.java:926)&lt;br/&gt;
                at com.google.common.collect.Iterators.advance(Iterators.java:979)&lt;br/&gt;
                at com.google.common.collect.Iterables$10.iterator(Iterables.java:904)&lt;br/&gt;
                at com.google.common.collect.Iterables$10.iterator(Iterables.java:902)&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="22831">YANGTOOLS-411</key>
            <summary>StackOverflowError for leafref</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="martin.ciglan">Martin Ciglan</assignee>
                                    <reporter username="minna.hu@ericsson.com">Minna Hu</reporter>
                        <labels>
                    </labels>
                <created>Sat, 14 Feb 2015 01:00:50 +0000</created>
                <updated>Sun, 10 Apr 2022 18:35:29 +0000</updated>
                            <resolved>Thu, 18 Jun 2015 11:03:10 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="43283" author="minna.hu@ericsson.com" created="Sat, 14 Feb 2015 01:00:50 +0000"  >&lt;p&gt;Attachment ietf-ospf@2014-09-17.yang has been added with description: ietf-ospf&lt;/p&gt;</comment>
                            <comment id="43276" author="tony.tkacik@gmail.com" created="Mon, 16 Feb 2015 13:13:13 +0000"  >&lt;p&gt;interface-operation {&lt;br/&gt;
     list neighbor {&lt;br/&gt;
         description&lt;br/&gt;
           &quot;List of neighbors.&quot;;&lt;br/&gt;
         leaf neighbor-id {&lt;br/&gt;
           type leafref &lt;/p&gt;
{
             path &quot;../../neighbor/neighbor-id&quot;;
           }
&lt;p&gt;        }&lt;br/&gt;
     }&lt;/p&gt;




&lt;p&gt;This seems bit weird - this set of leafrefs references themselves (recursive definition), so there is not initial set of valid values, need to co &lt;/p&gt;


&lt;p&gt;Definitelly StackOverflowError is bug, but looking at original model - that one is not correct also. I believe that path should be ../../../&lt;br/&gt;
path ../../ points to place where interface-operation is used, and then applying&lt;br/&gt;
neighbor/neighbor-id will point back to that particular leafref.&lt;/p&gt;</comment>
                            <comment id="43277" author="minna.hu@ericsson.com" created="Tue, 17 Feb 2015 10:07:01 +0000"  >&lt;p&gt;Thanks, Tony! The model is from IETF, I did not know why they defined the model in this way. &lt;/p&gt;

&lt;p&gt;You had good founding, the model will definitely causes StackOverflowError. Besides modifying the model, is there any way to handle the situation in yang-tools? Thanks!&lt;/p&gt;</comment>
                            <comment id="43278" author="martin.ciglan" created="Mon, 23 Feb 2015 14:27:30 +0000"  >&lt;p&gt;I propose checking schema node and leafref itself (going through schema path) to see if they match (leafref referencing itself) and in that case, throw exception. &lt;/p&gt;

&lt;p&gt;work in progress...&lt;/p&gt;</comment>
                            <comment id="43279" author="minna.hu@ericsson.com" created="Tue, 24 Feb 2015 03:19:38 +0000"  >&lt;p&gt;Martin, thank you for your reply! Just to clarify, are you checking schema node and leafref? Or are you proposing for me to do that? Thanks!&lt;/p&gt;</comment>
                            <comment id="43280" author="martin.ciglan" created="Tue, 24 Feb 2015 07:27:38 +0000"  >&lt;p&gt;I am actually working on it, will come back to you with result&lt;/p&gt;</comment>
                            <comment id="43281" author="rovarga" created="Thu, 11 Jun 2015 18:41:40 +0000"  >&lt;p&gt;Needs to be fixed before Lithium goes out.&lt;/p&gt;</comment>
                            <comment id="43282" author="martin.ciglan" created="Tue, 16 Jun 2015 14:30:17 +0000"  >&lt;p&gt;fix pushed:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/22698/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/22698/&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="13011" name="ietf-ospf@2014-09-17.yang" size="75250" author="minna.hu@ericsson.com" created="Sat, 14 Feb 2015 01:00:50 +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_10208" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>External issue ID</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2721</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=2721]]></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="10373"><![CDATA[Lithium-RC3]]></customfieldvalue>

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

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