<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:10:29 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-668]  Issue serializing object type defined by a leafref</title>
                <link>https://jira.opendaylight.org/browse/MDSAL-668</link>
                <project id="10137" key="MDSAL">mdsal</project>
                    <description>&lt;p&gt;In TransportPCE, we have encountered an issue since Silicon with the implementation of org-openroadm-device@2020-05-29.yang model.&lt;br/&gt;
 The problem is located in line 1300:&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;leaf-list port-list {
  type leafref {
    path &quot;/org-openroadm-device/circuit-packs[circuit-pack-name=current()/../circuit-pack-name]/ports/port-name&quot;;
  }

  description &quot;port list&quot;;
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;The List&amp;lt;?&amp;gt; type of port-list, generated during compilation of the model, seems not being taken into account during serialization step and throws an IllegalStateException:&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;Caused by: java.lang.IllegalStateException: Unexpected return type ?
	at org.opendaylight.mdsal.binding.dom.codec.impl.BindingCodecContext.getLeafNodesUsingReflection(BindingCodecContext.java:386) ~[?:?]
	at org.opendaylight.mdsal.binding.dom.codec.impl.BindingCodecContext.getLeafNodes(BindingCodecContext.java:355) ~[?:?]
	at org.opendaylight.mdsal.binding.dom.codec.impl.DataObjectCodecContext.&amp;lt;init&amp;gt;(DataObjectCodecContext.java:102) ~[?:?]
	at org.opendaylight.mdsal.binding.dom.codec.impl.ListNodeCodecContext.&amp;lt;init&amp;gt;(ListNodeCodecContext.java:28) ~[?:?]
	at org.opendaylight.mdsal.binding.dom.codec.impl.KeyedListNodeCodecContext.&amp;lt;init&amp;gt;(KeyedListNodeCodecContext.java:54) ~[?:?]
	at org.opendaylight.mdsal.binding.dom.codec.impl.KeyedListNodeCodecContext$Unordered.&amp;lt;init&amp;gt;(KeyedListNodeCodecContext.java:41) ~[?:?]
	at org.opendaylight.mdsal.binding.dom.codec.impl.KeyedListNodeCodecContext.create(KeyedListNodeCodecContext.java:71) ~[?:?]
	at org.opendaylight.mdsal.binding.dom.codec.impl.DataContainerCodecPrototype.createInstance(DataContainerCodecPrototype.java:237) ~[?:?]
	at org.opendaylight.mdsal.binding.dom.codec.impl.DataContainerCodecPrototype.loadInstance(DataContainerCodecPrototype.java:224) ~[?:?]
	at org.opendaylight.mdsal.binding.dom.codec.impl.DataContainerCodecPrototype.get(DataContainerCodecPrototype.java:220) ~[?:?]
	at org.opendaylight.mdsal.binding.dom.codec.impl.DataObjectCodecContext.streamChild(DataObjectCodecContext.java:195) ~[?:?]
	at org.opendaylight.mdsal.binding.dom.codec.impl.CodecDataObject.codecMember(CodecDataObject.java:81) ~[?:?]
	at org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.circuit.pack.Ports$$$codecImpl.getSupportingPortList(Unknown Source) ~[?:?]
	at org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.circuit.pack.Ports$$$streamer.serialize(Unknown Source) ~[?:?]
	at org.opendaylight.mdsal.binding.dom.codec.impl.DataObjectStreamer.commonStreamList(DataObjectStreamer.java:153) ~[?:?]
	at org.opendaylight.mdsal.binding.dom.codec.impl.DataObjectStreamer.streamMap(DataObjectStreamer.java:133) ~[?:?]
	at org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.circuit.packs.CircuitPacks$$$streamer.serialize(Unknown Source) ~[?:?]
	at org.opendaylight.mdsal.binding.dom.codec.impl.BindingCodecContext$DataObjectSerializerProxy.serialize(BindingCodecContext.java:121) ~[?:?]
	at org.opendaylight.mdsal.binding.dom.codec.impl.BindingCodecContext.toNormalizedNode(BindingCodecContext.java:506) ~[?:?]
	at org.opendaylight.mdsal.binding.dom.codec.spi.ForwardingBindingDOMCodecServices.toNormalizedNode(ForwardingBindingDOMCodecServices.java:66) ~[?:?]
	at org.opendaylight.mdsal.binding.dom.codec.spi.ForwardingBindingDOMCodecServices.toNormalizedNode(ForwardingBindingDOMCodecServices.java:66) ~[?:?]
	at org.opendaylight.mdsal.binding.dom.adapter.BindingDOMWriteTransactionAdapter.toNormalized(BindingDOMWriteTransactionAdapter.java:107) ~[?:?]
	at org.opendaylight.mdsal.binding.dom.adapter.BindingDOMWriteTransactionAdapter.toNormalized(BindingDOMWriteTransactionAdapter.java:100) ~[?:?]
	at org.opendaylight.mdsal.binding.dom.adapter.BindingDOMWriteTransactionAdapter.merge(BindingDOMWriteTransactionAdapter.java:50) ~[?:?]
	at org.opendaylight.transportpce.common.device.DeviceTransaction.merge(DeviceTransaction.java:66) ~[?:?]
	at org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl710.postEquipmentState(OpenRoadmInterfacesImpl710.java:225) ~[?:?]
	at org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl.postEquipmentState(OpenRoadmInterfacesImpl.java:127) ~[?:?]&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="34110">MDSAL-668</key>
            <summary> Issue serializing object type defined by a leafref</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="gthouenon">Gilles Thouenon</reporter>
                        <labels>
                    </labels>
                <created>Tue, 15 Jun 2021 16:12:50 +0000</created>
                <updated>Wed, 16 Jun 2021 14:21:14 +0000</updated>
                            <resolved>Wed, 16 Jun 2021 14:21:14 +0000</resolved>
                                                    <fixVersion>8.0.0</fixVersion>
                    <fixVersion>7.0.8</fixVersion>
                                    <component>Binding runtime</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="69305" author="rovarga" created="Tue, 15 Jun 2021 20:08:10 +0000"  >&lt;p&gt;The ISE is caused by our inability to deal with WildcardType, from whence we should be taking the upper bound &#8211; but that will typically not exist, so we&apos;d circle to Object.class and defer to NOOP codec &#8211; which is what we have historically done.&lt;/p&gt;

&lt;p&gt;While that would happen to work for the concrete case at hand, it is the incorrect thing to do in general.&lt;/p&gt;

&lt;p&gt;The List could contain InstanceIdentifier (which needs to be translated to YangInstanceIdentifiers), j.l.Class (which needs to be translated to QNames), or various generated TypeObject subclasses (which need to be decapsulated/translated).&lt;/p&gt;

&lt;p&gt;At the end of the day, the current approach to codec lookup is inadequate, as the codec link cannot always be accurately ascertained by pure reflection. This, by the way, also affect leaf nodes, but is hidden by the fact we return an Object and (again) default to NOOP codec.&lt;/p&gt;</comment>
                            <comment id="69306" author="rovarga" created="Tue, 15 Jun 2021 21:59:59 +0000"  >&lt;p&gt;This case can only happen when the leafref target cannot be resolved, which means the binding construct is somewhere inside a grouping and therefore we are (again) dealing with an ambiguity coming from not operating on instantiated context &#8211; i.e. the construct at hand &lt;b&gt;could&lt;/b&gt; end up being interpreted as List&amp;lt;InstanceIdentifier&amp;gt; or List&amp;lt;String&amp;gt; in two different instantiations of the grouping where it is defined.&lt;/p&gt;

&lt;p&gt;There are multiple difficulties here:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;establishing instantiation cardinality of the grouping at hand. There can be 0, 1, or more instantiations. For 0 instantiations we should not be hitting this case anyway and we should never be calling on this codec (because there is no NormalizedNode manifestation). For one instantiation, we can use type information from that instantiation and inline it in the grouping scope &#8211; and use a static codec just as we do in other cases.&lt;/li&gt;
	&lt;li&gt;for multiple instantiations we need to determine what the possible typing instantiation is. If we can prove it is always the same type, we can again hoist as in the case of a single instantiation. For multiple resulting types we need to have polymorphic codec, which is somehow specialized for each possible instantiation.&lt;/li&gt;
	&lt;li&gt;we also need to deal with the first two in a scalable manner, which hopefully does not force us outside of our well-trodded lazy initialization mode of operation. That probably requires communicating (on-demand?) instantiation information along the $$$streamer/$$$codecImpl chain.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;The good news is that if we can determine cardinatility to be 1, we can also use the currently-unused CodecDataObjectGenerator.Fixed, which offers runtime performance benefits, as noted in &lt;a href=&quot;https://jira.opendaylight.org/browse/MDSAL-443&quot; title=&quot;Inline CodecDataObject&amp;#39;s NodeContextSuppliers&quot; class=&quot;issue-link&quot; data-issue-key=&quot;MDSAL-443&quot;&gt;MDSAL-443&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="69312" author="rovarga" created="Wed, 16 Jun 2021 10:00:41 +0000"  >&lt;p&gt;So the ISE is in scope of this issue. Correction of codec lookup is part of &lt;a href=&quot;https://jira.opendaylight.org/browse/MDSAL-670&quot; title=&quot;BindingCodecContext does not deal with unresolved leafrefs&quot; class=&quot;issue-link&quot; data-issue-key=&quot;MDSAL-670&quot;&gt;MDSAL-670&lt;/a&gt;, which will be done separately.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10300">
                    <name>Issue split</name>
                                            <outwardlinks description="split to">
                                        <issuelink>
            <issuekey id="34114">MDSAL-670</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="34113">MDSAL-669</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="16300" name="model-test.tar.gz" size="410067" author="gthouenon" created="Tue, 15 Jun 2021 16:11:26 +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_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i03ycv:</customfieldvalue>

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