<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:10:02 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-533] Generated code with incompatible types</title>
                <link>https://jira.opendaylight.org/browse/MDSAL-533</link>
                <project id="10137" key="MDSAL">mdsal</project>
                    <description>&lt;p&gt;module&lt;/p&gt;

&lt;p&gt;&#160;&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;module a {
  yang-version 1;
  namespace &quot;a&quot;;
  prefix &quot;a&quot;;

  grouping foo_grp {
    leaf key_leaf1 {
      type leafref {
        path &quot;../../../a:foo_list/a:name&quot;;
      }
    }
    leaf key_leaf2 {
      type string;
    }
    leaf key_leaf3 {
      type string;
    }
  }
  container foo_cont {
    list foo_list {
      key &quot;name&quot;;
      leaf name {
        type string {
          length &quot;1..255&quot;;
        }
      }
    }
    container foo_cont2 {
      list foo_list2 {
        key &quot;key_leaf1 key_leaf2 key_leaf3&quot;;
        uses foo_grp;
      }
    }
  }
}&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;generates code with no error but when maven tries to compile it will receive an error:&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&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.8.0:compile (default-compile) on project lighty-models-skeleton: Compilation failure
[ERROR] /home/miroslav/projects/java/pt-ldl/distribution/scripts/user/java/lighty-models-skeleton/target/generated-sources/mdsal-binding/org/opendaylight/yang/gen/v1/a/norev/foo_cont/foo_cont2/FooList2Builder.java:[157,60] incompatible types: java.lang.Object cannot be converted to java.lang.String&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;the problem is with following generated code:&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&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;
        FooList2Impl(FooList2Builder base) {
            &lt;span class=&quot;code-keyword&quot;&gt;super&lt;/span&gt;(base.augmentation);
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (base.key() != &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
                &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;.key = base.key();
            } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;.key = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; FooList2Key(base.getKeyLeaf1(), base.getKeyLeaf2(), base.getKeyLeaf3());
            }
            &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;._keyLeaf1 = key.getKeyLeaf1();
            &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;._keyLeaf2 = key.getKeyLeaf2();
            &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;._keyLeaf3 = key.getKeyLeaf3();
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;here we can see that it is trying to create instance of FooList2KEY with three keys from base. Where base is:&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&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;
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;class &lt;/span&gt;FooList2Builder &lt;span class=&quot;code-keyword&quot;&gt;implements&lt;/span&gt; Builder&amp;lt;FooList2&amp;gt; {    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;      &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt; _keyLeaf1;
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; _keyLeaf2;
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; _keyLeaf3;
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; FooList2Key key;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;as you can see the first field is Object _keyLeaf1 which is a problem because FooList2Key constructor is generated like this:&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;
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; FooList2Key(&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; _keyLeaf1, &lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; _keyLeaf2, &lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; _keyLeaf3) {
        &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;._keyLeaf1 = _keyLeaf1;
        &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;._keyLeaf2 = _keyLeaf2;
        &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;._keyLeaf3 = _keyLeaf3;
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;String _keyLeaf1 !!!&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="32470">MDSAL-533</key>
            <summary>Generated code with incompatible types</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="ilyaigushev">Ilya Igushev</assignee>
                                    <reporter username="miro.kovac">Miroslav Kovac</reporter>
                        <labels>
                    </labels>
                <created>Wed, 11 Mar 2020 13:35:44 +0000</created>
                <updated>Sat, 12 Mar 2022 00:47:00 +0000</updated>
                            <resolved>Sat, 19 Dec 2020 11:53:10 +0000</resolved>
                                                    <fixVersion>7.0.3</fixVersion>
                                    <component>Binding codegen</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                    <issuelinks>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                                                <inwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="33712">MDSAL-651</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="31515">MDSAL-426</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="35336">MDSAL-732</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </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|i03ren:</customfieldvalue>

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