Use refcounting to lower the number of registrations 18/83418/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 29 Jul 2019 11:09:13 +0000 (13:09 +0200)
committerRobert Varga <nite@hq.sk>
Tue, 6 Aug 2019 11:09:36 +0000 (11:09 +0000)
commitfdd972b410fa6929e241fa9481c29eaac3de1a94
tree1427773cf75976a6a08cf231324e61873c8cda64
parentc90808fe07050de3c0b9bf8cf872933079254c4b
Use refcounting to lower the number of registrations

The fix for MDSAL-461 has introduced multiple registrations for
each YangModuleInfo, which while correct ends up parsing the same
sources multiple times.

This patch updates the handling to guard against that possibility
by adding an explicit reference counting layer, so that each
instance of YangModuleInfo is registered exactly once.

Change-Id: Id925391241cd36a26bfa05cd28f8b747d5d7ba24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 066ee3a904b39637ed7861d3aee2d55d67987139)
binding/mdsal-binding-generator-impl/src/main/java/org/opendaylight/mdsal/binding/generator/impl/ModuleInfoBackedContext.java