Use Objects.hashCode()
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / builder / impl / ModuleBuilder.java
index ef57f51e3f3fe78aa882a30eb2fad74682ceb8c7..07e1c9b6058dd58995e4a71618eccec742a3bab6 100644 (file)
@@ -1,9 +1,11 @@
 /*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
+
 package org.opendaylight.yangtools.yang.parser.builder.impl;
 
 import com.google.common.base.Charsets;
@@ -21,6 +23,7 @@ import java.util.LinkedHashSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 import java.util.TreeSet;
 import org.opendaylight.yangtools.yang.common.QName;
@@ -1068,9 +1071,9 @@ public class ModuleBuilder extends AbstractDocumentedDataNodeContainerBuilder im
     public int hashCode() {
         final int prime = 31;
         int result = 1;
-        result = prime * result + ((name == null) ? 0 : name.hashCode());
+        result = prime * result + Objects.hashCode(name);
         result = prime * result + qnameModule.hashCode();
-        result = prime * result + ((prefix == null) ? 0 : prefix.hashCode());
+        result = prime * result + Objects.hashCode(prefix);
 
         return result;
     }