<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:54: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>[YANGTOOLS-992] Submodule importing extension from different file failed</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-992</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;If the yang submodule is importing external module and using its extension, the build is failing with exception (see bellow). If the import of external module is added to the parent module of the submodule, it works.&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;
[ERROR] yang-to-sources: Unable to generate sources with org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl generator
java.lang.IllegalArgumentException: Failed to find prefix &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; statement (urn:example:module2?revision=2019-05-17)ext1
&#160;&#160;&#160; at com.google.common.base.Preconditions.checkArgument (Preconditions.java:210)
&#160;&#160;&#160; at org.opendaylight.yangtools.yang.model.export.ExportUtils.statementPrefix (ExportUtils.java:62)
&#160;&#160;&#160; at org.opendaylight.yangtools.yang.model.export.YangTextSnippetIterator.pushStatement (YangTextSnippetIterator.java:199)
&#160;&#160;&#160; at org.opendaylight.yangtools.yang.model.export.YangTextSnippetIterator.computeNext (YangTextSnippetIterator.java:160)
&#160;&#160;&#160; at org.opendaylight.yangtools.yang.model.export.YangTextSnippetIterator.computeNext (YangTextSnippetIterator.java:42)
&#160;&#160;&#160; at com.google.common.collect.AbstractIterator.tryToComputeNext (AbstractIterator.java:140)
&#160;&#160;&#160; at com.google.common.collect.AbstractIterator.hasNext (AbstractIterator.java:135)
&#160;&#160;&#160; at org.opendaylight.mdsal.binding.java.api.generator.BaseTemplate.appendYangSnippet (BaseTemplate.java:424)
&#160;&#160;&#160; at org.opendaylight.mdsal.binding.java.api.generator.BaseTemplate.appendSnippet (BaseTemplate.java:391)
&#160;&#160;&#160; at org.opendaylight.mdsal.binding.java.api.generator.BaseTemplate.formatDataForJavaDoc (BaseTemplate.java:342)
&#160;&#160;&#160; at org.opendaylight.mdsal.binding.java.api.generator.InterfaceTemplate.body (InterfaceTemplate.java:73)
&#160;&#160;&#160; at org.opendaylight.mdsal.binding.java.api.generator.BaseTemplate.generate (BaseTemplate.java:88)
&#160;&#160;&#160; at org.opendaylight.mdsal.binding.java.api.generator.InterfaceGenerator.generate (InterfaceGenerator.java:34)
&#160;&#160;&#160; at org.opendaylight.mdsal.binding.java.api.generator.GeneratorJavaFile$GeneratorStringSupplier.get (GeneratorJavaFile.java:54)
&#160;&#160;&#160; at org.opendaylight.mdsal.binding.java.api.generator.GeneratorJavaFile$GeneratorStringSupplier.get (GeneratorJavaFile.java:43)
&#160;&#160;&#160; at org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl.generateSources (CodeGeneratorImpl.java:113)
&#160;&#160;&#160; at org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesProcessor.generateSourcesWithOneGenerator (YangToSourcesProcessor.java:380)
&#160;&#160;&#160; at org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesProcessor.generateSources (YangToSourcesProcessor.java:330)
&#160;&#160;&#160; at org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesProcessor.conditionalExecute (YangToSourcesProcessor.java:157)
&#160;&#160;&#160; at org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesMojo.execute (YangToSourcesMojo.java:124)
&#160;&#160;&#160; at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
&#160;&#160;&#160; at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
&#160;&#160;&#160; at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
&#160;&#160;&#160; at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
&#160;&#160;&#160; at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
&#160;&#160;&#160; at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
&#160;&#160;&#160; at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
&#160;&#160;&#160; at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
&#160;&#160;&#160; at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
&#160;&#160;&#160; at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
&#160;&#160;&#160; at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
&#160;&#160;&#160; at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
&#160;&#160;&#160; at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
&#160;&#160;&#160; at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
&#160;&#160;&#160; at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
&#160;&#160;&#160; at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
&#160;&#160;&#160; at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
&#160;&#160;&#160; at java.lang.reflect.Method.invoke (Method.java:498)
&#160;&#160;&#160; at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
&#160;&#160;&#160; at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
&#160;&#160;&#160; at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
&#160;&#160;&#160; at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[ERROR] yang-to-sources: One or more code generators failed, including failed list(generatorClass=exception) {org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl=java.lang.IllegalArgumentException}

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="31692">YANGTOOLS-992</key>
            <summary>Submodule importing extension from different file failed</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</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="rovarga">Robert Varga</assignee>
                                    <reporter username="apuchyova">Anna Benc&#250;rov&#225;</reporter>
                        <labels>
                    </labels>
                <created>Fri, 17 May 2019 09:44:40 +0000</created>
                <updated>Fri, 31 Jan 2020 12:04:00 +0000</updated>
                            <resolved>Fri, 31 Jan 2020 12:04:00 +0000</resolved>
                                    <version>2.0.16</version>
                                    <fixVersion>5.0.0</fixVersion>
                    <fixVersion>3.0.10</fixVersion>
                    <fixVersion>4.0.7</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="66821" author="rovarga" created="Thu, 23 May 2019 17:56:05 +0000"  >&lt;p&gt;The problem is the grouping in here and the fact it is inlined in the base module (see&#160;AbstractEffectiveModule) &#8211; MD-SAL codegen knows nothing about submodules, nor should it. The prefix resolver relies on the effective import map known to the module and it does not traverse additional imports (as inlined). So we have an effective statement, whose declared counterpart lives in a different module and there is not enough information retained, as the import statements are not inlined.&lt;/p&gt;

&lt;p&gt;This only affects root module statements, hence it is possible to get around this by special-casing the case when we have submodules and match them up on identity. Ugly, but it should work.&lt;/p&gt;</comment>
                            <comment id="66822" author="rovarga" created="Thu, 23 May 2019 18:04:29 +0000"  >&lt;p&gt;DeclaredStatementFormatter is constructing the prefix map, and I think it should be able to discern when a statement is coming from submodule &#8211; but that is probably a costly operation.&lt;/p&gt;</comment>
                            <comment id="66823" author="rovarga" created="Thu, 23 May 2019 19:40:11 +0000"  >&lt;p&gt;The problem is also that the cross-relationship passed from MD-SAL is not limited to top-level nodes &#8211; it can be any nested node. I think the fix here should be:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;index submodule imports (either in export or in actual EffectiveSubmoduleStatement)&lt;/li&gt;
	&lt;li&gt;fall back to checking per-module imports for a prefix match if we fail to find a prefix &#8211; this needs then be re-assured by finding the statement&lt;/li&gt;
	&lt;li&gt;that is really saying that there is a bloom filter for prefixes &#8211; where conflicts are not likely, but can happen&lt;/li&gt;
	&lt;li&gt;costly operation is validation, which involves a linear search of all of submodule&apos;s substatements (comparing on identity), so that needs to be avoided&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The resulting lookup class is probably a good candidate for yang-model-util, but it cannot really be tested there, so keeping it in yang-model-export is good enough.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="66824" author="rovarga" created="Thu, 23 May 2019 19:43:54 +0000"  >&lt;p&gt;Another option is to include prefix mapping at each effective statement &#8211; but that is not really helpful, as we are working on declared statements.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="15215" name="module1@2019-05-17.yang" size="230" author="apuchyova" created="Fri, 17 May 2019 09:42:23 +0000"/>
                            <attachment id="15217" name="module1submodule1@2019-05-17.yang" size="368" author="apuchyova" created="Fri, 17 May 2019 09:42:23 +0000"/>
                            <attachment id="15216" name="module2@2019-05-17.yang" size="282" author="apuchyova" created="Fri, 17 May 2019 09:42:23 +0000"/>
                    </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|i03nvb:</customfieldvalue>

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