Use Objects.hashCode()
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / effective / GroupingEffectiveStatementImpl.java
index 636ef1e740beb0175d9c28ca81ae36c7118b1100..9a337d271390e871c34f0d446c9898179e34ee92 100644 (file)
@@ -1,11 +1,17 @@
-package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
+/*
+ * Copyright (c) 2015 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
+ */
 
-import java.util.Set;
-import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContextUtils;
+package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
 
 import java.util.Collection;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Objects;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
@@ -38,7 +44,7 @@ public class GroupingEffectiveStatementImpl extends
     private void initCopyType(
             StmtContext<QName, GroupingStatement, EffectiveStatement<QName, GroupingStatement>> ctx) {
 
-        Set<TypeOfCopy> copyTypesFromOriginal = StmtContextUtils.getCopyTypesFromOriginal(ctx);
+        List<TypeOfCopy> copyTypesFromOriginal = ctx.getCopyHistory();
 
         if(copyTypesFromOriginal.contains(TypeOfCopy.ADDED_BY_USES)) {
             addedByUses = true;
@@ -83,8 +89,8 @@ public class GroupingEffectiveStatementImpl extends
     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 + Objects.hashCode(qname);
+        result = prime * result + Objects.hashCode(path);
         return result;
     }
 
@@ -125,4 +131,4 @@ public class GroupingEffectiveStatementImpl extends
         sb.append("]");
         return sb.toString();
     }
-}
\ No newline at end of file
+}