Reduce cyclomatic complexity
[yangtools.git] / yang / yang-model-util / src / main / java / org / opendaylight / yangtools / yang / model / util / MustDefinitionImpl.java
index d361fa98c643bdcb73643c52349b35d23a9bd423..90b64767a32c07e326206f61a55c48799e28167d 100644 (file)
@@ -84,7 +84,7 @@ public final class MustDefinitionImpl implements MustDefinition {
     public int hashCode() {
         final int prime = 31;
         int result = 1;
-        result = prime * result + Objects.hashCode(mustStr);
+        result = prime * result + mustStr.hashCode();
         result = prime * result + Objects.hashCode(description);
         result = prime * result + Objects.hashCode(reference);
         return result;
@@ -95,28 +95,16 @@ public final class MustDefinitionImpl implements MustDefinition {
         if (this == obj) {
             return true;
         }
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
+        if (!(obj instanceof MustDefinitionImpl)) {
             return false;
         }
         final MustDefinitionImpl other = (MustDefinitionImpl) obj;
-        if (!Objects.equals(mustStr, other.mustStr)) {
-            return false;
-        }
-        if (!Objects.equals(description, other.description)) {
-            return false;
-        }
-        if (!Objects.equals(reference, other.reference)) {
-            return false;
-        }
-        return true;
+        return mustStr.equals(other.mustStr) && Objects.equals(description, other.description)
+                && Objects.equals(reference, other.reference);
     }
 
     @Override
     public String toString() {
         return mustStr;
     }
-
 }