Use pattern matching on instanceof in yang-common
[yangtools.git] / common / yang-common / src / main / java / org / opendaylight / yangtools / yang / common / Uint16.java
index 7671c7f15f763e8fe3c6845515d8a861645a724a..dbce6e91b741b130c0d0e65c1770232cbdca4715 100644 (file)
@@ -395,7 +395,7 @@ public class Uint16 extends Number implements CanonicalValue<Uint16> {
 
     @Override
     public final boolean equals(final @Nullable Object obj) {
-        return this == obj || obj instanceof Uint16 && value == ((Uint16)obj).value;
+        return this == obj || obj instanceof Uint16 other && value == other.value;
     }
 
     /**