<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:09: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>[MDSAL-273] Binding Data Codec: Java Implementation  is not compatible with Binding DataObject Proxy for binary type</title>
                <link>https://jira.opendaylight.org/browse/MDSAL-273</link>
                <project id="10137" key="MDSAL">mdsal</project>
                    <description>&lt;p&gt;The java Implementation  is not compatible with the corresponding binding dataObject proxy for binary type. &lt;br/&gt;
It means that if a XX DataObject is constructed using its XXBuilder, you use its getter method to get the binay type value, the cloned byte[] is returned.&lt;br/&gt;
If the dataObject is retrieved from datastore with databroker, the dataobject is a proxy of NormalizdeNode,and you use its getter method to get the binay type value, the real byte[] reference is returned which is the same reference as the one in NormalizdeNode. &lt;br/&gt;
Now if you changed the byte[] reference such as the value of index 1, now the original  NormalizdeNode will be affected. Is this a bug? Is the behavior desired? I think it should be the same behavior both of the java Implementation and the binding dataObject proxy.&lt;/p&gt;

&lt;p&gt;The reason bebind this behavior is that the ValueTypeCodec for binay type is NOOP_CODEC, whose source code is below:&lt;br/&gt;
    /**&lt;br/&gt;
     *&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;No-op Codec, Java YANG Binding uses same types as NormalizedNode model&lt;/li&gt;
	&lt;li&gt;for base YANG types, representing numbers, binary and strings.&lt;br/&gt;
     *&lt;br/&gt;
     *&lt;br/&gt;
     */&lt;br/&gt;
    public static final SchemaUnawareCodec NOOP_CODEC = new SchemaUnawareCodec() {&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;        @Override&lt;br/&gt;
        public Object serialize(final Object input) &lt;/p&gt;
{
            return input;
        }&lt;br/&gt;
&lt;br/&gt;
        @Override&lt;br/&gt;
        public Object deserialize(final Object input) {            return input;        }
&lt;p&gt;    };&lt;/p&gt;

&lt;p&gt;As shown above, all of number and binary and string type all use NOOP_CODEC, but number and string is invariant, but the representation of binary type is byte array which is variant. &lt;/p&gt;

&lt;p&gt;The bug is a back door to change the value of binary type?&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="27095">MDSAL-273</key>
            <summary>Binding Data Codec: Java Implementation  is not compatible with Binding DataObject Proxy for binary type</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="-1">Unassigned</assignee>
                                    <reporter username="wusandi@163.com">wu sandi</reporter>
                        <labels>
                    </labels>
                <created>Thu, 6 Jul 2017 05:55:29 +0000</created>
                <updated>Fri, 9 Mar 2018 18:00:21 +0000</updated>
                            <resolved>Fri, 26 Jan 2018 16:04:02 +0000</resolved>
                                                    <fixVersion>Carbon</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="54715" author="wusandi@163.com" created="Thu, 6 Jul 2017 06:18:43 +0000"  >&lt;p&gt;In addition, although the byte array is changed for binay type, the hashCode of the NormalizedNode which owns the binary type is not changed. So its a little strange, the value changed but the hashCode not changed.&lt;/p&gt;</comment>
                            <comment id="54716" author="wusandi@163.com" created="Thu, 6 Jul 2017 08:41:16 +0000"  >&lt;p&gt;In addition, the java type of the container node is ImmutableContainerNode. It is immutable, but due to binary type, it seems to be mutable(real changed, but its hashcode is not changed). Much more strange!&lt;/p&gt;</comment>
                            <comment id="54717" author="martin.ciglan" created="Mon, 10 Jul 2017 07:23:19 +0000"  >&lt;p&gt;quite busy now, will check this out later on and respond... leaving UNCONFIRMED&lt;/p&gt;</comment>
                            <comment id="60842" author="rovarga" created="Fri, 26 Jan 2018 16:04:02 +0000"  >&lt;p&gt;Fixed in yangtools via &lt;a href=&quot;https://git.opendaylight.org/gerrit/61464&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/61464&lt;/a&gt;.&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>8806</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=8806]]></customfieldvalue>

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

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