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