X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=yang%2Fyang-data-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fdata%2Fimpl%2Fleafref%2FLeafRefPath.java;h=ff8aa82a23f8c46e0d4d709b6bf538e230277a18;hb=92bf9a24324b155a65c93ceaa0be13f6152ad55c;hp=8f092dfebd321e661fbd9326c81b438d542e6e49;hpb=881fb9e1db92bc3997138e164e899041b62013d1;p=yangtools.git diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/LeafRefPath.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/LeafRefPath.java index 8f092dfebd..ff8aa82a23 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/LeafRefPath.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/LeafRefPath.java @@ -12,8 +12,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; import java.util.Arrays; import java.util.Iterator; -import java.util.List; import java.util.NoSuchElementException; +import java.util.Objects; import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; import org.opendaylight.yangtools.concepts.Immutable; @@ -106,25 +106,11 @@ public abstract class LeafRefPath implements Immutable { return ret; } - /** - * Returns the complete path to schema node. - * - * @return list of QNameWithPredicate instances which - * represents complete path to schema node - * - * @deprecated Use {@link #getPathFromRoot()} instead. - */ - @Deprecated - public List getPath() { - return getLegacyPath(); - } - - protected LeafRefPath(final LeafRefPath parent, - final QNameWithPredicate qname) { + protected LeafRefPath(final LeafRefPath parent, final QNameWithPredicate qname) { this.parent = parent; this.qname = qname; - int h = parent == null ? 0 : parent.hashCode(); + int h = Objects.hashCode(parent); if (qname != null) { h = h * 31 + qname.hashCode(); } @@ -328,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