<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:09:53 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-470] Add DataObject default methods</title>
                <link>https://jira.opendaylight.org/browse/MDSAL-470</link>
                <project id="10137" key="MDSAL">mdsal</project>
                    <description>&lt;p&gt;Generated DTOs capture their Object-related mechanics in two places:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;compile-time Builder implementations&lt;/li&gt;
	&lt;li&gt;runtime codec bridge implementations&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Both of these should be indiscernible by the user, but there are subtle differences between them. It would be nice if we could eliminate those differences.&lt;/p&gt;

&lt;p&gt;A way to do that is to generate defaultToString() methods, like this:&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;
&lt;span class=&quot;code-keyword&quot;&gt;interface&lt;/span&gt; Foo &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; DataObject {
    Bar getBar();

    &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; bindingToString(&lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; Foo obj) {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;Foo [bar = &quot;&lt;/span&gt; + obj.getBar() + &lt;span class=&quot;code-quote&quot;&gt;&quot;]&quot;&lt;/span&gt;;
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Generated builders, as well as generated bridges can then do a simple:&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;
@Override
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; toString() {
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; defaultToString(&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;which will result in the implementation being shared. This applies to hashCode()/equals() as well.&lt;/p&gt;</description>
                <environment></environment>
        <key id="31946">MDSAL-470</key>
            <summary>Add DataObject default methods</summary>
                <type id="10000" iconUrl="https://jira.opendaylight.org/images/icons/issuetypes/epic.svg">Epic</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="ilyaigushev">Ilya Igushev</assignee>
                                    <reporter username="rovarga">Robert Varga</reporter>
                        <labels>
                            <label>pt</label>
                    </labels>
                <created>Tue, 3 Sep 2019 20:33:54 +0000</created>
                <updated>Mon, 20 Jul 2020 17:22:09 +0000</updated>
                            <resolved>Mon, 20 Jul 2020 17:22:09 +0000</resolved>
                                                    <fixVersion>7.0.0</fixVersion>
                                    <component>Binding codegen</component>
                    <component>Binding runtime</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                                                            <comments>
                            <comment id="67216" author="rovarga" created="Tue, 3 Sep 2019 20:45:17 +0000"  >&lt;p&gt;These methods are not meant to for end-user consumption, so &quot;default&quot; may not be a great prefix to use.&lt;/p&gt;

&lt;p&gt;There is a potential improvement here, as with &lt;a href=&quot;https://openjdk.java.net/jeps/280&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;JEP 280&lt;/a&gt; (Java 9) string concat can be expressed so that the JVM understands them and can produce near-perfect code. While we could leverage those capabilities at runtime (which is what matters), doing so is an untrivial amount of bytecode engineering. If we can emit that as compile-time code, javac will do all that work for us. That would mean ditching ToStringHelper/CodeHelpers from the picture, though &#8211; bytecode impact of that needs to be evaluated.&lt;/p&gt;</comment>
                            <comment id="67217" author="rovarga" created="Tue, 3 Sep 2019 20:49:19 +0000"  >&lt;p&gt;I think we can allocate &quot;binding&quot;, &quot;java&quot; prefix or similar. We could also overload hashCode() et al. with hashCode(DataObject), but that incurs wrath of static analysis, as well as bringing it closer to users (who would be confused by two equals() methods).&lt;/p&gt;

&lt;p&gt;Let&apos;s go with &quot;binding&quot;, as in &quot;bindingHashCode()&quot;, &quot;bindingEquals()&quot;, &quot;bindingToString()&quot;.&lt;/p&gt;</comment>
                            <comment id="67218" author="rovarga" created="Tue, 3 Sep 2019 20:56:39 +0000"  >&lt;p&gt;Where augmentations are concerned, the methods should assume &apos;this&apos; is an augmentation holder, and throw an IllegalStateExeption if that is not the case. This checking logic should be stored in CodeHelpers.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                            <subtask id="31947">MDSAL-471</subtask>
                            <subtask id="31948">MDSAL-472</subtask>
                            <subtask id="31949">MDSAL-473</subtask>
                            <subtask id="31950">MDSAL-474</subtask>
                            <subtask id="31956">MDSAL-479</subtask>
                            <subtask id="31957">MDSAL-480</subtask>
                            <subtask id="26971">MDSAL-149</subtask>
                    </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|i03ov3:</customfieldvalue>

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