YANGTOOLS-844: Filtering/SimpleSchemaContext violate getModules() contract 12/67212/13
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 16 Jan 2018 16:21:50 +0000 (17:21 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 17 Jan 2018 17:30:11 +0000 (18:30 +0100)
getModules() is explicit about how the modules should be ordered,
which is not compatible with ModuleDependencySort. As it turns out
ModuleDependencySort is only needed in MD-SAL codegen, where we
already invoke it explicitly.

Explicitly sort modules according to requirements of getModules(),
fulfilling that contract.

This also affects findModule(String) and related functions, which
are sorted, but in inverse order of what is specified. Fix that
by adjusting AbstractSchemaContext.REVISION_COMPARATOR and
introducing NAME_REVISION_COMPARATOR for use in places where modules
are not guaranteed to have a unique name.

Change-Id: Ie91685b830694764158381e4696e3f7d5bb57fba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>

No differences found