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