Use Objects.hashCode()
[yangtools.git] / yang / yang-model-util / src / main / java / org / opendaylight / yangtools / yang / model / util / MustDefinitionImpl.java
index 3acb23041c14dce9bcc1caca712481ac1081cc34..5e2949efbd9178f603e568f15398c1a5850ddf72 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.yangtools.yang.model.util;
 
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
+import java.util.Objects;
 import org.opendaylight.yangtools.yang.model.api.MustDefinition;
 import org.opendaylight.yangtools.yang.model.api.RevisionAwareXPath;
 
@@ -83,9 +84,9 @@ public final class MustDefinitionImpl implements MustDefinition {
     public int hashCode() {
         final int prime = 31;
         int result = 1;
-        result = prime * result + ((mustStr == null) ? 0 : mustStr.hashCode());
-        result = prime * result + ((description == null) ? 0 : description.hashCode());
-        result = prime * result + ((reference == null) ? 0 : reference.hashCode());
+        result = prime * result + Objects.hashCode(mustStr);
+        result = prime * result + Objects.hashCode(description);
+        result = prime * result + Objects.hashCode(reference);
         return result;
     }