From 280563325a83c8093df03a8444e058fd94652059 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Wed, 8 Nov 2017 12:16:51 +0100 Subject: [PATCH 1/1] Remove ModuleDependencySort.sort(Iterable) This method has been replaced with the collection-based one, remove the old one. Change-Id: Iecb4d7c8085869196ecff040e1e8594f368ee408 Signed-off-by: Robert Varga --- .../yang/model/util/ModuleDependencySort.java | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/ModuleDependencySort.java b/yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/ModuleDependencySort.java index 1306b59b9a..1d04ee310f 100644 --- a/yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/ModuleDependencySort.java +++ b/yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/ModuleDependencySort.java @@ -53,33 +53,18 @@ public final class ModuleDependencySort { * @throws IllegalArgumentException when provided modules are not consistent. */ public static List sort(final Collection modules) { - return sort((Iterable)modules); - } - - /** - * Topological sort of module dependency graph. - * - * @param modules YANG modules - * @return Sorted list of Modules. Modules can be further processed in - * returned order. - * @throws IllegalArgumentException when provided modules are not consistent. - * - * @deprecated Use {@link #sort(Collection)} instead. - */ - @Deprecated - public static List sort(final Iterable modules) { final List sorted = sortInternal(modules); // Cast to Module from Node and return return Lists.transform(sorted, input -> input == null ? null : ((ModuleNodeImpl) input).getReference()); } - private static List sortInternal(final Iterable modules) { + private static List sortInternal(final Collection modules) { final Table, ModuleNodeImpl> moduleGraph = createModuleGraph(modules); return TopologicalSort.sort(new HashSet<>(moduleGraph.values())); } private static Table, ModuleNodeImpl> createModuleGraph( - final Iterable builders) { + final Collection builders) { final Table, ModuleNodeImpl> moduleGraph = HashBasedTable.create(); processModules(moduleGraph, builders); @@ -92,7 +77,7 @@ public final class ModuleDependencySort { * Extract module:revision from modules. */ private static void processDependencies(final Table, ModuleNodeImpl> moduleGraph, - final Iterable mmbs) { + final Collection mmbs) { final Map allNS = new HashMap<>(); // Create edges in graph -- 2.36.6