[MDSAL-281] Binding v2 generator exception: Type parameter MUST be specified and cannot be NULL Created: 31/Jul/17  Updated: 09/Mar/18  Resolved: 14/Aug/17

Status: Resolved
Project: mdsal
Component/s: Binding V2 codegen
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Andrej Záň Assignee: Jie Han
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 8911

 Description   

When generating sources for this model:

module test {

yang-version 1;
namespace "urn:opendaylight:params:xml:ns:yang:test";
prefix "test";

revision "2017-02-24"

{ description "Initial revision of test model."; }

container testContainer {
list testList {
leaf testLeaf

{ type string; }

}
}

notification testLeafrefNotification {
leaf tesLeafref {
type leafref

{ path "/test:testContainer/test:testList/test:testLeaf"; }

}
}

}

then this exception is thrown:

[ERROR] yang-to-sources: Unable to generate sources with org.opendaylight.mdsal.binding.javav2.maven.api.gen.plugin.CodeGeneratorImpl generator
java.lang.IllegalArgumentException: Type parameter MUST be specified and cannot be NULL!
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122)
at org.opendaylight.mdsal.binding.javav2.java.api.generator.renderers.BaseRenderer.putTypeIntoImports(BaseRenderer.java:150)
at org.opendaylight.mdsal.binding.javav2.java.api.generator.renderers.BaseRenderer.importedName(BaseRenderer.java:72)
at org.opendaylight.mdsal.binding.javav2.java.api.generator.renderers.BuilderRenderer.body(BuilderRenderer.java:256)
at org.opendaylight.mdsal.binding.javav2.java.api.generator.renderers.BaseRenderer.generateTemplate(BaseRenderer.java:363)
at org.opendaylight.mdsal.binding.javav2.java.api.generator.BuilderGenerator.generate(BuilderGenerator.java:39)
at org.opendaylight.mdsal.binding.javav2.java.api.generator.GeneratorJavaFile.generateTypeToJavaFile(GeneratorJavaFile.java:192)
at org.opendaylight.mdsal.binding.javav2.java.api.generator.GeneratorJavaFile.generateToFile(GeneratorJavaFile.java:106)
at org.opendaylight.mdsal.binding.javav2.maven.api.gen.plugin.CodeGeneratorImpl.generateSources(CodeGeneratorImpl.java:91)
at org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesProcessor.generateSourcesWithOneGenerator(YangToSourcesProcessor.java:333)
at org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesProcessor.generateSources(YangToSourcesProcessor.java:275)
at org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesProcessor.execute(YangToSourcesProcessor.java:96)
at org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesProcessor.conditionalExecute(YangToSourcesProcessor.java:117)
at org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesMojo.execute(YangToSourcesMojo.java:121)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:200)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:196)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
[ERROR] yang-to-sources: One or more code generators failed, including failed list(generatorClass=exception)

{org.opendaylight.mdsal.binding.javav2.maven.api.gen.plugin.CodeGeneratorImpl=java.lang.IllegalArgumentException}

If notification is changed to container, then code generation pass, but generated code is not compilable what is already mentioned in MDSAL-279



 Comments   
Comment by Jie Han [ 03/Aug/17 ]

Fixed by this patch:
https://git.opendaylight.org/gerrit/61085

Comment by Jie Han [ 14/Aug/17 ]

carbon: https://git.opendaylight.org/gerrit/61602

Comment by A H [ 14/Aug/17 ]

A patch was submitted to revert the changes and fix this bug in Carbon SR2:

https://git.opendaylight.org/gerrit/#/c/61602

To better assess the impact of this bug and fix, could someone from your team please help us identify the following:
Regression: Is this bug a regression of functionality/performance/feature compared to Carbon SR1?
Severity: Could you elaborate on the severity of this bug? Is this a BLOCKER such that we cannot release Carbon SR2 without it?
Workaround: Is there a workaround such that we can write a release note instead?
Testing: Could you also elaborate on the testing of this patch? How extensively has this patch been tested? Is it covered by any unit tests or system tests?
Impact: Does this fix impact any dependent projects?

Comment by A H [ 14/Aug/17 ]

Reopening bug because related patches in Carbon SR2 have not been merged yet:

https://git.opendaylight.org/gerrit/#/c/61602

Comment by Robert Varga [ 14/Aug/17 ]

Regression:

No.

Severity:

The issue prevents Binding v2 from being adopted by our end users,

Workaround:

None.

Testing:

The patch includes a unit test for the specific failure and has not introduced any detectable regression.

Impact:

The fix for this issue has no effect on downstream projects within the Simultaneous Release. The presence of this issue blocks adoption of a Carbon feature by our end users. Given the timeline (our next Carbon deliverable is SR3 on 11/9), I believe it is crucial we deliver the fix in SR2.

Generated at Wed Feb 07 20:09:22 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.