Use Objects.hashCode()
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / effective / type / LengthConstraintEffectiveImpl.java
index be0e5e2f33d4d2f1247cc5cb9b68765846601dc9..2912bddcf22b2f0c05ca8eafd69e6eac46399dc8 100644 (file)
@@ -7,12 +7,10 @@
  */
 package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type;
 
-import org.opendaylight.yangtools.yang.model.api.type.LengthConstraint;
-
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
-
 import java.util.Objects;
+import org.opendaylight.yangtools.yang.model.api.type.LengthConstraint;
 
 public class LengthConstraintEffectiveImpl implements LengthConstraint {
 
@@ -73,12 +71,12 @@ public class LengthConstraintEffectiveImpl implements LengthConstraint {
     public int hashCode() {
         final int prime = 31;
         int result = 1;
-        result = prime * result + ((description == null) ? 0 : description.hashCode());
+        result = prime * result + Objects.hashCode(description);
         result = prime * result + errorAppTag.hashCode();
         result = prime * result + errorMessage.hashCode();
         result = prime * result + max.hashCode();
         result = prime * result + min.hashCode();
-        result = prime * result + ((reference == null) ? 0 : reference.hashCode());
+        result = prime * result + Objects.hashCode(reference);
         return result;
     }