X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=xpath%2Fyang-xpath-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fxpath%2Fapi%2FYangLocationPath.java;h=5e2cd065ddcd1e90fb3980dcdd53b0b945529a98;hb=4248f4a3b94775cab515f14a63d2331c9be80e9e;hp=e987baa9f373e7ba01134461dbfcc5374ca9dcbf;hpb=039ce35af37222ba07670c6515dc8b3457bfc12f;p=yangtools.git diff --git a/xpath/yang-xpath-api/src/main/java/org/opendaylight/yangtools/yang/xpath/api/YangLocationPath.java b/xpath/yang-xpath-api/src/main/java/org/opendaylight/yangtools/yang/xpath/api/YangLocationPath.java index e987baa9f3..5e2cd065dd 100644 --- a/xpath/yang-xpath-api/src/main/java/org/opendaylight/yangtools/yang/xpath/api/YangLocationPath.java +++ b/xpath/yang-xpath-api/src/main/java/org/opendaylight/yangtools/yang/xpath/api/YangLocationPath.java @@ -77,14 +77,8 @@ public abstract sealed class YangLocationPath implements YangExpr { @Override public final boolean equals(@Nullable final Object obj) { - if (this == obj) { - return true; - } - if (!(obj instanceof AxisStep)) { - return false; - } - final AxisStep other = (AxisStep) obj; - return getAxis().equals(other.getAxis()) && getPredicates().equals(other.getPredicates()); + return this == obj || obj instanceof AxisStep other && getAxis().equals(other.getAxis()) + && getPredicates().equals(other.getPredicates()); } @SuppressFBWarnings(value = "SE_PRIVATE_READ_RESOLVE_NOT_INHERITED", @@ -132,15 +126,8 @@ public abstract sealed class YangLocationPath implements YangExpr { @Override public boolean equals(@Nullable final Object obj) { - if (this == obj) { - return true; - } - if (!(obj instanceof NamespaceStep)) { - return false; - } - final NamespaceStep other = (NamespaceStep) obj; - return getAxis().equals(other.getAxis()) && namespace.equals(other.namespace) - && getPredicates().equals(other.getPredicates()); + return this == obj || obj instanceof NamespaceStep other && getAxis().equals(other.getAxis()) + && namespace.equals(other.namespace) && getPredicates().equals(other.getPredicates()); } @Override @@ -467,14 +454,8 @@ public abstract sealed class YangLocationPath implements YangExpr { @Override public final boolean equals(final @Nullable Object obj) { - if (this == obj) { - return true; - } - if (!(obj instanceof YangLocationPath)) { - return false; - } - final YangLocationPath other = (YangLocationPath) obj; - return isAbsolute() == other.isAbsolute() && steps.equals(other.steps); + return this == obj || obj instanceof YangLocationPath other && isAbsolute() == other.isAbsolute() + && steps.equals(other.steps); } @Override