Use Objects.hashCode()
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / effective / type / EnumSpecificationEffectiveStatementImpl.java
index d7812e911a10092bcd4b53fc80229a9b7ffde1b7..fca2532227d5630bacaf0f024d36149ace62b128 100644 (file)
@@ -12,6 +12,7 @@ import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import java.util.Objects;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.YangConstants;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
@@ -112,10 +113,10 @@ public class EnumSpecificationEffectiveStatementImpl extends
     public int hashCode() {
         final int prime = 31;
         int result = 1;
-        result = prime * result + ((defaultEnum == null) ? 0 : defaultEnum.hashCode());
-        result = prime * result + ((enums == null) ? 0 : enums.hashCode());
+        result = prime * result + Objects.hashCode(defaultEnum);
+        result = prime * result + Objects.hashCode(enums);
         result = prime * result + QNAME.hashCode();
-        result = prime * result + ((path == null) ? 0 : path.hashCode());
+        result = prime * result + Objects.hashCode(path);
         return result;
     }