Bug 4640: Change semantic-version to openconfig-version
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / util / TopologicalSort.java
index 7d3ba2aee42f7ebc65deb6c2f4360b1670c7c252..42db14607eed2e7b4d20dda9bd9156b99050a1e1 100644 (file)
@@ -11,6 +11,7 @@ import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 import java.util.List;
+import java.util.Objects;
 import java.util.Set;
 
 /**
@@ -27,6 +28,7 @@ public final class TopologicalSort {
     /**
      * Topological sort of dependent nodes in acyclic graphs.
      *
+     * @param nodes graph nodes
      * @return Sorted {@link List} of {@link Node}s. Order: Nodes with no
      *         dependencies starting.
      * @throws IllegalStateException
@@ -156,8 +158,8 @@ public final class TopologicalSort {
         public int hashCode() {
             final int prime = 31;
             int result = 1;
-            result = prime * result + ((from == null) ? 0 : from.hashCode());
-            result = prime * result + ((to == null) ? 0 : to.hashCode());
+            result = prime * result + Objects.hashCode(from);
+            result = prime * result + Objects.hashCode(to);
             return result;
         }