Use refcounting to lower the number of registrations 96/83296/2
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 29 Jul 2019 11:09:13 +0000 (13:09 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 5 Aug 2019 13:01:55 +0000 (15:01 +0200)
commit066ee3a904b39637ed7861d3aee2d55d67987139
treea27201c8f3cdb5359438f502f565c71c55c54403
parentd50b9a01f6230480e62cf38f8190077df7b91a00
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>
binding/mdsal-binding-generator-impl/src/main/java/org/opendaylight/mdsal/binding/generator/impl/ModuleInfoBackedContext.java