<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:52:43 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-257] generated builder java file for a leaf containing a union needs documentation for why it&apos;s stored in src/main/java</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-257</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;This is a shortened example from the TTP repo.&lt;/p&gt;

&lt;p&gt;If you have YANG like this:&lt;/p&gt;

&lt;p&gt;    ...&lt;br/&gt;
    list parameters {&lt;br/&gt;
      ...&lt;br/&gt;
      leaf default {&lt;br/&gt;
        type union &lt;/p&gt;
{
          type string;
          type uint32;
        }
&lt;p&gt;      }&lt;br/&gt;
      ...&lt;br/&gt;
    }&lt;br/&gt;
    ...&lt;/p&gt;

&lt;p&gt;The DefaultBuilder.java winds up being stored in src/main/java instead of the configured directory.&lt;/p&gt;



&lt;p&gt;The same thing happens with PortNumberBuilder.java in controller. Which is generated to opendaylight/md-sal/model/model-flow-base/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/flow/types/port/rev130925/PortNumberBuilder.java&lt;/p&gt;

&lt;p&gt;While it&apos;s counterparts are generated to opendaylight/md-sal/model/model-flow-base/src/main/yang-gen-sal/org/opendaylight/yang/gen/v1/urn/opendaylight/...&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: Mac OS&lt;br/&gt;
Platform: PC&lt;/p&gt;</environment>
        <key id="22677">YANGTOOLS-257</key>
            <summary>generated builder java file for a leaf containing a union needs documentation for why it&apos;s stored in src/main/java</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="lborak@cisco.com">Ladislav Borak</assignee>
                                    <reporter username="colindixon">Colin Dixon</reporter>
                        <labels>
                    </labels>
                <created>Sat, 9 Aug 2014 18:55:53 +0000</created>
                <updated>Sun, 10 Apr 2022 18:35:14 +0000</updated>
                            <resolved>Tue, 14 Oct 2014 09:36:09 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="42944" author="colin@colindixon.com" created="Tue, 12 Aug 2014 16:59:31 +0000"  >&lt;p&gt;After talking to Devin Avery and Tom Pantelis, I think that this isn&apos;t a bug in that it&apos;s placed in the wrong location, but rather a bug in that the &lt;b&gt;reason&lt;/b&gt; that it&apos;s placed here isn&apos;t properly conveyed.&lt;/p&gt;

&lt;p&gt;Ideally, this generate class&apos;s functionality would be automated, but in the meantime a comment needs to be added to explain that the person creating the model needs to add code, what that code needs to do, and what happens if they don&apos;t.&lt;/p&gt;</comment>
                            <comment id="42945" author="mmarsale@cisco.com" created="Thu, 14 Aug 2014 08:55:39 +0000"  >&lt;p&gt;The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation. In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32). &lt;/p&gt;

&lt;p&gt;The reason behind putting it under src/main/java is:&lt;br/&gt;
This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent loss of user code.&lt;/p&gt;

&lt;p&gt;I agree with you, that a comment should be added to such classes.&lt;/p&gt;</comment>
                            <comment id="42946" author="colin@colindixon.com" created="Thu, 14 Aug 2014 16:04:10 +0000"  >&lt;p&gt;(In reply to Maros Marsalek from comment #2)&lt;br/&gt;
&amp;gt; The purpose of generated class in src/main/java for Union types is to create&lt;br/&gt;
&amp;gt; new instances of unions from a string representation. In some cases it is&lt;br/&gt;
&amp;gt; very difficult to automate it since there can be unions such as (uint32 -&lt;br/&gt;
&amp;gt; uint16), or (string - uint32). &lt;/p&gt;

&lt;p&gt;The YANG spec actually says the correct thing to do here is to use the first listed type in the union for which it can be correctly interpreted.&lt;/p&gt;

&lt;p&gt;&quot;When a string representing a union data type is validated, the string is validated against each member type, in the order they are specified in the &quot;type&quot; statement, until a match is found.&quot;&lt;/p&gt;

&lt;p&gt;From here: &lt;a href=&quot;http://www.yang-central.org/twiki/pub/Main/YangDocuments/rfc6020.html#rfc.section.9.12&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://www.yang-central.org/twiki/pub/Main/YangDocuments/rfc6020.html#rfc.section.9.12&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I &lt;b&gt;think&lt;/b&gt; we should be able to do this automatically, but I may be wrong.&lt;/p&gt;</comment>
                            <comment id="42947" author="lborak@cisco.com" created="Fri, 15 Aug 2014 07:59:15 +0000"  >&lt;p&gt;proposed patch: &lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/9952/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/9952/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please create new enhancement for your last comment.&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>1512</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=1512]]></customfieldvalue>

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

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

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