Use Objects.hashCode()
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / impl / ParserListenerUtils.java
index 49d6d986a3dc27837e50df14b16e70dc0fd4e426..ae97dd34955d5bb931d0bfcb78ab02e8e437d1b9 100644 (file)
@@ -20,6 +20,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Objects;
 import java.util.Set;
 import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
@@ -469,11 +470,11 @@ public final class ParserListenerUtils {
         public int hashCode() {
             final int prime = 31;
             int result = 1;
-            result = prime * result + ((qname == null) ? 0 : qname.hashCode());
-            result = prime * result + ((path == null) ? 0 : path.hashCode());
-            result = prime * result + ((unknownNodes == null) ? 0 : unknownNodes.hashCode());
-            result = prime * result + ((name == null) ? 0 : name.hashCode());
-            result = prime * result + ((value == null) ? 0 : value.hashCode());
+            result = prime * result + Objects.hashCode(qname);
+            result = prime * result + Objects.hashCode(path);
+            result = prime * result + Objects.hashCode(unknownNodes);
+            result = prime * result + Objects.hashCode(name);
+            result = prime * result + Objects.hashCode(value);
             return result;
         }