Use pattern matching on instanceof in yang-common
[yangtools.git] / common / yang-common / src / main / java / org / opendaylight / yangtools / yang / common / QNameModule.java
index a4f345f6e6d7ea3a95b1fe54efb8870ec924cfa5..bfaa2f23eb921a05a3b2c345fb3d9b9de272e9ab 100644 (file)
@@ -155,14 +155,8 @@ public final class QNameModule implements Comparable<QNameModule>, Immutable, Se
 
     @Override
     public boolean equals(final Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!(obj instanceof QNameModule)) {
-            return false;
-        }
-        final QNameModule other = (QNameModule) obj;
-        return Objects.equals(revision, other.revision) && namespace.equals(other.namespace);
+        return this == obj || obj instanceof QNameModule other
+            && Objects.equals(revision, other.revision) && namespace.equals(other.namespace);
     }
 
     @Override