Bug 9242: Reuse deviating statement contexts 06/64406/4
authorIgor Foltin <igor.foltin@pantheon.tech>
Tue, 17 Oct 2017 14:08:18 +0000 (16:08 +0200)
committerRobert Varga <nite@hq.sk>
Tue, 24 Oct 2017 09:23:13 +0000 (09:23 +0000)
commitfc9ba6f9d58c154bfa5816b038a616d97e89b683
tree9fe64a2c9d7a21e68526d2f98212417511b6d74f
parentef4809e31921a84da26bcc40a23ad46735892079
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]