[YANGTOOLS-469] NullPointerException when including a submodule of a more recent revision than the module Created: 18/Jun/15  Updated: 10/Apr/22  Resolved: 20/Oct/15

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Claudia Hwang Assignee: Peter Kajsa
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Zip Archive test_yang.zip    
External issue ID: 3799

 Description   

Attached are two yang files, a simple module which includes a submodule. When parsing them a NullPointerException occurs:

java.lang.NullPointerException
at org.opendaylight.yangtools.yang.parser.builder.impl.GroupingUtils.getTargetGroupingFromModules(GroupingUtils.java:59)
at org.opendaylight.yangtools.yang.parser.impl.YangParserImpl.resolveUsesTargetGrouping(YangParserImpl.java:1083)
at org.opendaylight.yangtools.yang.parser.impl.YangParserImpl.build(YangParserImpl.java:707)
at org.opendaylight.yangtools.yang.parser.impl.YangParserImpl.parseYangModelSources(YangParserImpl.java:354)
at org.opendaylight.yangtools.yang.parser.impl.YangParserImpl.parseSources(YangParserImpl.java:195)

It only happens when the submodule has a more recent revision date than the module. The include statement in the model specifies no revision date.

When debugging I can see that
org.opendaylight.yangtools.yang.parser.builder.impl.BuilderUtils.findModule(QName, Map<URI, TreeMap<Date, ModuleBuilder>>) is unable to find the correct module.

The Yangtools version is 0.6.5-Helium-SR3.



 Comments   
Comment by Claudia Hwang [ 18/Jun/15 ]

Attachment test_yang.zip has been added with description: Yang files demonstrating the problem

Comment by Martin Ciglan [ 30/Jul/15 ]

I was able to replicate this bug, we will look into it and come back to you.

Comment by Peter Kajsa [ 09/Sep/15 ]

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

Comment by Martin Ciglan [ 05/Oct/15 ]

cherry-pick to stable/lithium

https://git.opendaylight.org/gerrit/#/c/27806/2

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