<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:15:20 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>[NETCONF-563] NetconfMessageTransformUtil.toFilterStructure() fails for leaf instance identifiers</title>
                <link>https://jira.opendaylight.org/browse/NETCONF-563</link>
                <project id="10142" key="NETCONF">netconf</project>
                    <description>&lt;p&gt;This utility method is used by NETCONF plugin to create a filter expression and write it out. Unfortunately this functionality relied leaf nodes having a null value, which would in turn be recognized and ignored by codecs.&lt;/p&gt;

&lt;p&gt;Null-valued leaves are no longer available, which breaks the ability to create filters for simple leaves, rendering sal-netconf-connector inoperable for requests to read individual leaves.&lt;/p&gt;</description>
                <environment></environment>
        <key id="30635">NETCONF-563</key>
            <summary>NetconfMessageTransformUtil.toFilterStructure() fails for leaf instance identifiers</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.opendaylight.org/images/icons/priorities/critical.svg">High</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>Fri, 24 Aug 2018 13:27:09 +0000</created>
                <updated>Wed, 8 Dec 2021 12:29:56 +0000</updated>
                            <resolved>Tue, 4 Sep 2018 08:47:24 +0000</resolved>
                                    <version>Oxygen</version>
                    <version>Fluorine</version>
                                    <fixVersion>Neon</fixVersion>
                    <fixVersion>Oxygen SR4</fixVersion>
                    <fixVersion>Fluorine SR1</fixVersion>
                                    <component>netconf</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="64760" author="rovarga" created="Fri, 24 Aug 2018 13:28:56 +0000"  >&lt;p&gt;Stack trace of evidence:&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;java.lang.IllegalStateException: Value has not been set
&#160;&#160; &#160;at com.google.common.base.Preconditions.checkState(Preconditions.java:504) [81:com.google.guava:23.6.1.jre]
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.AbstractImmutableNormalizedNodeBuilder.getValue(AbstractImmutableNormalizedNodeBuilder.java:33) [323:org.opendaylight.yangtools.yang-data-impl:2.0.6.1]
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableLeafNodeBuilder.build(ImmutableLeafNodeBuilder.java:27) [323:org.opendaylight.yangtools.yang-data-impl:2.0.6.1]
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableLeafNodeBuilder.build(ImmutableLeafNodeBuilder.java:17) [323:org.opendaylight.yangtools.yang-data-impl:2.0.6.1]
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.data.impl.schema.InstanceIdToSimpleNodes.create(InstanceIdToSimpleNodes.java:50) [323:org.opendaylight.yangtools.yang-data-impl:2.0.6.1]
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.data.impl.schema.InstanceIdToCompositeNodes.create(InstanceIdToCompositeNodes.java:105) [323:org.opendaylight.yangtools.yang-data-impl:2.0.6.1]
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.data.impl.schema.InstanceIdToCompositeNodes.create(InstanceIdToCompositeNodes.java:105) [323:org.opendaylight.yangtools.yang-data-impl:2.0.6.1]
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.data.impl.schema.InstanceIdToCompositeNodes.create(InstanceIdToCompositeNodes.java:105) [323:org.opendaylight.yangtools.yang-data-impl:2.0.6.1]
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.data.impl.schema.InstanceIdToCompositeNodes.create(InstanceIdToCompositeNodes.java:105) [323:org.opendaylight.yangtools.yang-data-impl:2.0.6.1]
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.data.impl.schema.InstanceIdToCompositeNodes.create(InstanceIdToCompositeNodes.java:105) [323:org.opendaylight.yangtools.yang-data-impl:2.0.6.1]
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.fromInstanceId(ImmutableNodes.java:147) [323:org.opendaylight.yangtools.yang-data-impl:2.0.6.1]
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.fromInstanceId(ImmutableNodes.java:110) [323:org.opendaylight.yangtools.yang-data-impl:2.0.6.1]
&#160;&#160; &#160;at org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.toFilterStructure(NetconfMessageTransformUtil.java:187) [301:org.opendaylight.netconf.sal-netconf-connector:1.7.3]
&#160;&#160; &#160;at org.opendaylight.netconf.sal.connect.netconf.util.NetconfRpcStructureTransformer.toFilterStructure(NetconfRpcStructureTransformer.java:46) [301:org.opendaylight.netconf.sal-netconf-connector:1.7.3]
&#160;&#160; &#160;at org.opendaylight.netconf.sal.connect.netconf.util.NetconfBaseOps.getConfig(NetconfBaseOps.java:185) [301:org.opendaylight.netconf.sal-netconf-connector:1.7.3]
&#160;&#160; &#160;at org.opendaylight.netconf.sal.connect.netconf.util.NetconfBaseOps.getConfigRunning(NetconfBaseOps.java:223) [301:org.opendaylight.netconf.sal-netconf-connector:1.7.3]
&#160;&#160; &#160;at org.opendaylight.netconf.sal.connect.netconf.util.NetconfBaseOps.getConfigRunningData(NetconfBaseOps.java:199) [301:org.opendaylight.netconf.sal-netconf-connector:1.7.3]
&#160;&#160; &#160;at org.opendaylight.netconf.sal.connect.netconf.sal.tx.ReadOnlyTx.readConfigurationData(ReadOnlyTx.java:43) [301:org.opendaylight.netconf.sal-netconf-connector:1.7.3]
&#160;&#160; &#160;at org.opendaylight.netconf.sal.connect.netconf.sal.tx.ReadOnlyTx.read(ReadOnlyTx.java:67) [301:org.opendaylight.netconf.sal-netconf-connector:1.7.3]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="64761" author="rovarga" created="Fri, 24 Aug 2018 13:32:49 +0000"  >&lt;p&gt;One way of fixing this would be to store Empty instance in the leaf, but that would only paper over the problem, leading to a failure to serialize the data, as both JSON and XML codecs rely on schema information to select the correct codec &#8211; leading to ClassCastException when the leaf&apos;s value is accessed for serialization.&lt;/p&gt;

&lt;p&gt;Another way would be to select an &apos;empty&apos; value, which could work except numeric types do not have such a value &#8211; leading to a partially-working solution.&lt;/p&gt;</comment>
                            <comment id="64762" author="rovarga" created="Fri, 24 Aug 2018 14:22:05 +0000"  >&lt;p&gt;This is an extreme edge case, which should be handled in NETCONF. toFilterStructure() is returning an anyxml node, for which it really needs only an Element with proper structure to use in DOMSource. Current code does this rather inefficiently by creating a NormalizedNode from YangInstanceIdentifier and then instantiating XML codec pipeline to encode that into the target Element.&lt;/p&gt;

&lt;p&gt;Skipping the NormalizedNode/codec steps will remove the edge case and also improve the performance of this method.&lt;/p&gt;</comment>
                            <comment id="64763" author="rovarga" created="Fri, 24 Aug 2018 14:25:17 +0000"  >&lt;p&gt;The code looks like this, making it clear there is block we can replace:&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;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; Element element = XmlUtil.createElement(BLANK_DOCUMENT, NETCONF_FILTER_QNAME.getLocalName(),
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Optional.of(NETCONF_FILTER_QNAME.getNamespace().toString()));
&#160;&#160;&#160;&#160;&#160;&#160;&#160; element.setAttributeNS(NETCONF_FILTER_QNAME.getNamespace().toString(), NETCONF_TYPE_QNAME.getLocalName(),
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;subtree&quot;&lt;/span&gt;);

&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt; {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; NetconfUtil.writeNormalizedNode(ImmutableNodes.fromInstanceId(ctx, identifier), &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; DOMResult(element),
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SchemaPath.ROOT, ctx);
&#160;&#160;&#160;&#160;&#160;&#160;&#160; } &lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt; (IOException | XMLStreamException e) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; IllegalStateException(&lt;span class=&quot;code-quote&quot;&gt;&quot;Unable to serialize filter element &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; path &quot;&lt;/span&gt; + identifier, e);
&#160;&#160;&#160;&#160;&#160;&#160;&#160; }
&#160;&#160;&#160;&#160;&#160;&#160;&#160; anyXmlBuilder.withValue(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; DOMSource(element));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="64771" author="rovarga" created="Sun, 26 Aug 2018 18:40:01 +0000"  >&lt;p&gt;So here we need the XML serializer to deal with leaf values (in case of NodeIdentifierWithPredicates), but for that we certainly do not need a NormalizedNode representation of the YangInstanceIdentifier. Hence NetconfUtil should grow a writeYangInstanceIdentifier(), which will instantiate the XML codec (to deal with values) and drive it using NormalizedNodeStreamWriter interface based on the content of YangInstanceIdentifier.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="30650">YANGTOOLS-898</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="34922">NETCONF-833</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|i03i47:</customfieldvalue>

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