Fix a nullness thinko 11/67211/2
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 16 Jan 2018 16:18:04 +0000 (17:18 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 17 Jan 2018 10:27:36 +0000 (11:27 +0100)
toRevision cannot reasonably be null, as it already is an Optional,
hence the check here is incorrect and should instead check for
non-presence.

Change-Id: I93658ce5993aed1a02f4ad25121e11b3f31d356a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/ModuleDependencySort.java

index 1d04ee310fee44559d23ca5be1bdb710a9ccfc66..6a6b7ab648e0af2a8d5c16d92c50c3fb4377986a 100644 (file)
@@ -140,7 +140,7 @@ public final class ModuleDependencySort {
         }
 
         // If revision is not specified in import, but module exists with different revisions, take first one
-        if (toRevision == null) {
+        if (!toRevision.isPresent()) {
             final Map<Optional<Revision>, ModuleNodeImpl> modulerevs = moduleGraph.row(toName);
 
             if (!modulerevs.isEmpty()) {