<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:09:31 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-321] Binding V1 generates incorrect code for nested classes</title>
                <link>https://jira.opendaylight.org/browse/MDSAL-321</link>
                <project id="10137" key="MDSAL">mdsal</project>
                    <description>&lt;p&gt;A simple test model:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;&#160;&#160;&#160; container foo {
&#160;&#160;&#160;&#160;&#160;&#160;&#160; leaf foo {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; type enumeration {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; enum &quot;foo&quot;;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }
&#160;&#160;&#160;&#160;&#160;&#160;&#160; }
&#160;&#160;&#160; }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;results in compilation failure:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project mdsal-binding-test-model: Compilation failure: Compilation failure:
[ERROR] /home/nite/odl/mdsal/binding/mdsal-binding-test-model/target/generated-sources/mdsal-binding/org/opendaylight/yang/gen/v1/opendaylight/nested/types/norev/Foo.java:[98,69] cannot find symbol
[ERROR]&#160;&#160; symbol:&#160;&#160; class Foo
[ERROR]&#160;&#160; location: interface org.opendaylight.yang.gen.v1.opendaylight.nested.types.norev.Foo
[ERROR] /home/nite/odl/mdsal/binding/mdsal-binding-test-model/target/generated-sources/mdsal-binding/org/opendaylight/yang/gen/v1/opendaylight/nested/types/norev/Foo.java:[31,12] interface org.opendaylight.yang.gen.v1.opendaylight.nested.types.norev.Foo is already defined in package org.opendaylight.yang.gen.v1.opendaylight.nested.types.norev
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="29406">MDSAL-321</key>
            <summary>Binding V1 generates incorrect code for nested classes</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="rovarga">Robert Varga</reporter>
                        <labels>
                    </labels>
                <created>Mon, 12 Mar 2018 14:22:54 +0000</created>
                <updated>Wed, 2 May 2018 09:52:42 +0000</updated>
                            <resolved>Wed, 2 May 2018 09:52:16 +0000</resolved>
                                                    <fixVersion>Oxygen SR1</fixVersion>
                    <fixVersion>Fluorine</fixVersion>
                                    <component>Binding codegen</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="61677" author="rovarga" created="Mon, 12 Mar 2018 14:52:51 +0000"  >&lt;p&gt;This failure is a violation of JLS9 section 8.1:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;It is a compile-time error if a class has the same simple name as any of its enclosing classes or interfaces.&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Which means that we need to understand nesting so that we do not ever generated something like:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;class Foo {
    public static class Foo {
        public static class Foo {
        }
    }
}&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;In that block the first nested class must not have the name &apos;Foo&apos;. Assuming we pick &apos;Foo$&apos; as the replacement, the second nested class must not have names &apos;Foo&apos; or &apos;Foo$&apos;.&lt;/p&gt;</comment>
                            <comment id="61681" author="rovarga" created="Mon, 12 Mar 2018 17:14:55 +0000"  >&lt;p&gt;At first glance this seems to be specifically triggered by enumerations.&lt;/p&gt;</comment>
                            <comment id="61688" author="rovarga" created="Mon, 12 Mar 2018 17:50:18 +0000"  >&lt;p&gt;Solving this will be a bit of a ride, as we do not have the FQCN hierarchy captured anywhere &#8211; we use packageName to represent both the root module package and nested class&apos;s parent, hence crawling back is not a nice option, fraught with performance and correctness issues.&lt;/p&gt;</comment>
                            <comment id="61697" author="rovarga" created="Mon, 12 Mar 2018 20:39:27 +0000"  >&lt;p&gt;Preliminary cut:&lt;/p&gt;

&lt;p&gt;remote:&#160;&#160; &lt;a href=&quot;https://git.opendaylight.org/gerrit/69407&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/69407&lt;/a&gt; Add binding.model.api.TypeName&lt;br/&gt;
remote:&#160;&#160; &lt;a href=&quot;https://git.opendaylight.org/gerrit/69408&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/69408&lt;/a&gt; Integrate TypeName as Identifier&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="61698" author="rovarga" created="Mon, 12 Mar 2018 20:40:38 +0000"  >&lt;p&gt;This will be deeply invasive change, as it is forcing getting the packageName story in the codebase straight.&lt;/p&gt;</comment>
                            <comment id="61782" author="rovarga" created="Mon, 19 Mar 2018 01:18:12 +0000"  >&lt;p&gt;The fix itself: &lt;a href=&quot;https://git.opendaylight.org/gerrit/69599&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/69599&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                            <outwardlinks description="blocks">
                                        <issuelink>
            <issuekey id="29405">MDSAL-320</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <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_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i03bkf:</customfieldvalue>

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