<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:52:25 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-155] Union Codec serialize throws Class cast when the union object is passed</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-155</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;I have a union type in my yang schema&lt;/p&gt;

&lt;p&gt;leaf port-number {&lt;br/&gt;
            type union &lt;/p&gt;
{
                type uint32;
                type string;
            }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;through which it creates a PortNumber object.&lt;/p&gt;

&lt;p&gt;But the Union codec UnionCodecStringImpl.serialize accepts a String and not the union object PortNumber.&lt;/p&gt;

&lt;p&gt;The serialize() should be able to look for the types within the UnionTypeDefinition and return back the non-null value of the union.&lt;/p&gt;

&lt;p&gt;Following is the error i am getting:&lt;br/&gt;
osgi&amp;gt; 2014-05-05 18:25:52.634 PDT &lt;span class=&quot;error&quot;&gt;&amp;#91;http-bio-8080-exec-8&amp;#93;&lt;/span&gt; ERROR o.o.y.y.d.i.c.xml.XmlDocumentUtils - Provided node value PortNumber &lt;span class=&quot;error&quot;&gt;&amp;#91;_string=LOCAL&amp;#93;&lt;/span&gt; did not have type type (urn:ietf:params:xml:ns:yang:1)union (types=&lt;span class=&quot;error&quot;&gt;&amp;#91;, uint32, string&amp;#93;&lt;/span&gt; required by mapping. Using stream instead.&lt;br/&gt;
java.lang.ClassCastException: org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.CommonPort$PortNumber cannot be cast to java.lang.String&lt;br/&gt;
at org.opendaylight.yangtools.yang.data.impl.codec.TypeDefinitionAwareCodec$UnionCodecStringImpl.serialize(TypeDefinitionAwareCodec.java:548) ~&lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:na&amp;#93;&lt;/span&gt;&lt;br/&gt;
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlDocumentUtils.writeValueByType(XmlDocumentUtils.java:257) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:na&amp;#93;&lt;/span&gt;&lt;br/&gt;
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlDocumentUtils.writeValueByType(XmlDocumentUtils.java:218) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:na&amp;#93;&lt;/span&gt;&lt;br/&gt;
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlDocumentUtils.createXmlRootElement(XmlDocumentUtils.java:168) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:na&amp;#93;&lt;/span&gt;&lt;br/&gt;
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlDocumentUtils.createXmlRootElement(XmlDocumentUtils.java:189) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:na&amp;#93;&lt;/span&gt;&lt;br/&gt;
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlDocumentUtils.createXmlRootElement(XmlDocumentUtils.java:189) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:na&amp;#93;&lt;/span&gt;&lt;br/&gt;
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlDocumentUtils.toDocument(XmlDocumentUtils.java:112) &lt;span class=&quot;error&quot;&gt;&amp;#91;bundlefile:na&amp;#93;&lt;/span&gt;&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: Mac OS&lt;br/&gt;
Platform: PC&lt;/p&gt;</environment>
        <key id="22575">YANGTOOLS-155</key>
            <summary>Union Codec serialize throws Class cast when the union object is passed</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="kramesha@cisco.com">Kamal Rameshan</assignee>
                                    <reporter username="kramesha@cisco.com">Kamal Rameshan</reporter>
                        <labels>
                    </labels>
                <created>Wed, 7 May 2014 20:08:57 +0000</created>
                <updated>Sun, 10 Apr 2022 18:35:05 +0000</updated>
                            <resolved>Wed, 28 May 2014 08:46:59 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="42731" author="kramesha@cisco.com" created="Wed, 7 May 2014 21:08:22 +0000"  >&lt;p&gt;&lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/6799/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/6799/&lt;/a&gt; submitted for review&lt;/p&gt;</comment>
                            <comment id="42732" author="tpantelis" created="Mon, 19 May 2014 08:58:37 +0000"  >&lt;p&gt;This bug is similar to &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-160&quot; title=&quot;String needs to be changed to Object (or Enum) in the method TypeDefinitionAwareCodec$EnumCodecStringImpl.serialize&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-160&quot;&gt;&lt;del&gt;YANGTOOLS-160&lt;/del&gt;&lt;/a&gt;. I went down a similar path to modify the EnumCodecStringImpl, which works but the root cause is actually elsewhere in the codec toDomStatic method generated by the TransformerGenerator. The value instance should already be an appropriate String instance when it reaches the EnumCodecStringImpl/UnionCodecStringImpl.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                            <outwardlinks description="blocks">
                                        <issuelink>
            <issuekey id="27389">OPNFLWPLUG-121</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_10208" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>External issue ID</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>973</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=973]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10202" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Priority</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10301"><![CDATA[Normal]]></customfieldvalue>

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

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