Do not instantiate new maps in LeafRefContextBuilder
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / leafref / LeafRefPath.java
index 793c20a1fd53c78ae81c27e2dd627200ae76d7f0..ff8aa82a23f8c46e0d4d709b6bf538e230277a18 100644 (file)
@@ -314,21 +314,7 @@ public abstract class LeafRefPath implements Immutable {
             return false;
         }
         final LeafRefPath other = (LeafRefPath) obj;
-
-        if (qname != null) {
-            if (!qname.equals(other.qname)) {
-                return false;
-            }
-        } else {
-            if (other.qname != null) {
-                return false;
-            }
-        }
-
-        if (parent == null) {
-            return other.parent == null;
-        }
-        return parent.equals(other.parent);
+        return Objects.equals(qname, other.qname) && Objects.equals(parent, other.parent);
     }
 
     @Override