<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:10:47 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-734] Add utility classes for generating indented file content</title>
                <link>https://jira.opendaylight.org/browse/MDSAL-734</link>
                <project id="10137" key="MDSAL">mdsal</project>
                    <description>&lt;p&gt;In order to migrate from Xtend we need to replace &lt;a href=&quot;https://github.com/eclipse/xtext-lib/blob/v2.26.0/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtend2/lib/StringConcatenation.java&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;StringConcatenation&lt;/a&gt; with a sharp tool and use that to emit formatted blocks.&lt;br/&gt;
 We do not need to handle all the complexity of StringConcatenation, as we are always generating files top-down, appending intermediate code blocks, always in a linear fashion.&lt;/p&gt;

&lt;p&gt;Since we have modern Java, we can use try-with-resources to give us the basic building block for embedding. The code flow should look something like:&lt;/p&gt;

&lt;p&gt;&#160;&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;var&lt;/span&gt; builder = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ContentBuilder(4)
    .addLine(&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;class &lt;/span&gt;Foo {&quot;&lt;/span&gt;);

&lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; block = builder.openBlock()) {
    &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; field : fields) {
        generateFieldDeclaration(block, field);
    }

    builder.ensureEmptyLine();

    &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; ctor : constructors) {
        generateConstructor(block, ctor);
    }
}

&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; content = builder.addLine(&lt;span class=&quot;code-quote&quot;&gt;&quot;}&quot;&lt;/span&gt;).build();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Lines can be appended in whole, or built from components which do not contain a newline (we should be able to guarantee that 95% of time and we can split the remaining 5%). It remains to be seen what Text Blocks bring in terms of value and performance characteristics. ContentBuilder can have at most one block open and that block has to be closed by the time build() is called. Blocks can nested blocks created in much the same way.&lt;/p&gt;

&lt;p&gt;Note that the &apos;AutoCloseable&apos; interface exposed from openBlock() needs to be separate from the interface passed to &apos;generateFieldDeclaration&apos;, so that it is not possible to close it by mistake.&lt;/p&gt;</description>
                <environment></environment>
        <key id="35338">MDSAL-734</key>
            <summary>Add utility classes for generating indented file content</summary>
                <type id="10102" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10316&amp;avatarType=issuetype">Sub-task</type>
                            <parent id="32730">MDSAL-562</parent>
                                    <priority id="3" iconUrl="https://jira.opendaylight.org/images/icons/priorities/major.svg">Medium</priority>
                        <status id="10003" iconUrl="https://jira.opendaylight.org/images/icons/status_generic.gif" description="">Confirmed</status>
                    <statusCategory id="2" key="new" colorName="blue-gray"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="rovarga">Robert Varga</reporter>
                        <labels>
                    </labels>
                <created>Sat, 12 Mar 2022 09:43:37 +0000</created>
                <updated>Tue, 9 Jan 2024 09:13:32 +0000</updated>
                                                            <fixVersion>14.0.0</fixVersion>
                                    <component>Binding codegen</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                        <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|i041sn:</customfieldvalue>

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