<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:55:58 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>[YANGTOOLS-1372] Add support for purely-effective substatements</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-1372</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;StmtContext.Mutable does not expose the ability to conjure purely-effective statements, i.e. those which are truly inferred from overall context and do not have a DeclaredStatement counterpart.&lt;/p&gt;

&lt;p&gt;There are two use cases: implicit input/output statements in RPCs and Actions, which we cover through a rather ugly hack called StatementContextBase.appendImplicitSubstatement(). That part does still ends up creating a DeclaredStatement and also does not cover ModelStatement.argument() completely &#8211; for example it does not work for &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-1338&quot; title=&quot;Generate ietf-restconf operations leaf statements&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-1338&quot;&gt;&lt;del&gt;YANGTOOLS-1338&lt;/del&gt;&lt;/a&gt;, where the argument is a QName and we do not have a way to create a rawArgument String which would parse to what we need because we do not have the corresponding imports. Final deficiency is that it creates a SubstatementContext, i.e. having weird ties to declaration site.&lt;/p&gt;

&lt;p&gt;Expose a new method StmtContext.Mutable, which will create a truly effective-only statements. The argument should be an ImplicitStatementAwareSubstatementContext (or similar, as that is a mouthful), which is an additional interface implemented by things like InputStatementSupport and can work without a DeclaredStatement instance.&lt;/p&gt;</description>
                <environment></environment>
        <key id="35002">YANGTOOLS-1372</key>
            <summary>Add support for purely-effective substatements</summary>
                <type id="10103" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10311&amp;avatarType=issuetype">New Feature</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>Tue, 30 Nov 2021 17:08:49 +0000</created>
                <updated>Thu, 26 Oct 2023 18:34:36 +0000</updated>
                            <resolved>Thu, 16 Dec 2021 16:42:48 +0000</resolved>
                                                    <fixVersion>8.0.0</fixVersion>
                                    <component>parser</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                                                            <comments>
                            <comment id="70351" author="rovarga" created="Sun, 12 Dec 2021 21:42:52 +0000"  >&lt;p&gt;The current infra actually does something different &#8211; it is adding implicit statements, i.e. those still have a DeclaredStatement, but that declared statement shows up as being StatementOrigin.DECLARATION.&lt;/p&gt;

&lt;p&gt;In the reactor this is implied by the use of SubstatementContext for these statements. In individual statements supports (which support this) it shows up as special-casing in createDeclared(). In yang-model-ri this manifests as ImplicitStatements &#8211; which end up recognized in factory methods and ignored.&lt;/p&gt;

&lt;p&gt;This needs to work quite differently:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;we need an optional-to-implement UndeclaredStatementFactory, which will have an alternative createEffective() method, which does rely on DeclaredStatement&lt;/li&gt;
	&lt;li&gt;we need an UndeclaredStmtCtx in the reactor, which will support Mutable.addEffectiveSubstatement(), with a better name of addUndeclaredSubstatement() &#8211; and there needs to be a checkArgument() to verify that the supplied support implements UndeclaredStatementFactory&lt;/li&gt;
	&lt;li&gt;ImplicitStatements needs to be removed (along with the classes it references)&lt;/li&gt;
	&lt;li&gt;We need to have an UndeclaredStatements to directly create EffectiveStatement instances&lt;/li&gt;
	&lt;li&gt;Users of ImplicitStatements need to be migrated to implement UndeclaredStatementFactory&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;The be-all end-all reason is that we do not have a reliable raw argument String, required for DeclaredStatements. The other is quick consistency checks to an opt-in behaviour &#8211; i.e. RpcStatementSupport can only use implicit input statements because InputStatementSupport knows how to deal with them &#8211; and that capability is not exposed as a trait (such as UndeclaredStatementFactory ), it is just an implementation detail. The third, minor one, is that we create bogus objects to dance around StatementContextBase&apos;s requirement of having a DeclaredStatement instance.&lt;/p&gt;</comment>
                            <comment id="70352" author="rovarga" created="Mon, 13 Dec 2021 23:11:46 +0000"  >&lt;p&gt;Okay, this is a bit more complicated and boils down to ModelStatement.statementOrigin() and its interpretation in DeclaredStatement vs EffectiveStatement. Part of this is an implementation quirk of statement loading, where we end up inserting UndeclaredCaseStatement into DeclaredChoiceStatement:&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;choice foo {
   case bar;
   container baz;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;ends up looking like this:&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;ChoiceStatement foo
  DeclaredCaseStatement bar
  UndeclaredCaseStatement baz
    Container baz
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The difference between Declared and Undeclared CaseStatements is only statementOrigin(). We have to account for this in yang-model-export and inline StatementOrigin.CONTEXT statements&apos; substatements.&lt;/p&gt;

&lt;p&gt;We therefore need to perform a bit of house cleaning:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;eliminate generation of UndeclaredCaseStatement and instead inline Container baz, just as it is declared (&lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-1383&quot; title=&quot;Do not emit UndeclaredCaseStatements&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-1383&quot;&gt;&lt;del&gt;YANGTOOLS-1383&lt;/del&gt;&lt;/a&gt;)&lt;/li&gt;
	&lt;li&gt;move ModelStatement.statementOrigin() to EffectiveStatement, eliminating Undeclared* DeclaredStatements (&lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-1384&quot; title=&quot;Remove ModelStatement.statementSource()&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-1384&quot;&gt;&lt;del&gt;YANGTOOLS-1384&lt;/del&gt;&lt;/a&gt;)&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Once that is done, we can roll out proper specialized implementations.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                            <outwardlinks description="blocks">
                                        <issuelink>
            <issuekey id="34603">YANGTOOLS-1338</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="33896">YANGTOOLS-1270</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                            <subtask id="35039">YANGTOOLS-1383</subtask>
                            <subtask id="35040">YANGTOOLS-1384</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|i040un:</customfieldvalue>

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