Bug 9242: Reuse deviating statement contexts 44/64644/1
authorIgor Foltin <igor.foltin@pantheon.tech>
Tue, 17 Oct 2017 14:08:18 +0000 (16:08 +0200)
committerIgor Foltin <igor.foltin@pantheon.tech>
Tue, 24 Oct 2017 11:17:42 +0000 (13:17 +0200)
commit48c7bf2463a991cc801fcb3dad91aa9e5c0e18a1
tree878d9fce5d2df63d39fe6d673f269d03d3533bc3
parent4ca1ef912071a5af7a46bdd298315ae34dd0411f
Bug 9242: Reuse deviating statement contexts

In the process of deviate add/replace resolution we make
copies of deviated statement contexts which are then added
to the deviation target context.

However, making copies of these statement contexts is not
necessary except the ones which represent unknown statements.

Therefore, reuse them during the resolution of deviate add/replace.

By doing this, we also solve the failing deviate replace with
user-defined types as statement contexts that represent deviating
user-defined types are now resolved within their original context.

Change-Id: Ie61a38e270ef648fe61ea283805d149533c10f62
Signed-off-by: Igor Foltin <igor.foltin@pantheon.tech>
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/DeviateStatementImpl.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug9242Test.java [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug9242/imp-module-2.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug9242/imp-module.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/bugs/bug9242/root-module.yang [new file with mode: 0644]