Refactored equals in AugmentationSchemaImpl.
[controller.git] / opendaylight / sal / yang-prototype / code-generator / yang-model-parser-impl / src / main / java / org / opendaylight / controller / yang / parser / builder / impl / AugmentationSchemaBuilderImpl.java
index 29c38dfa0e727eaaba4c61adf7320f8893bb90c8..605ca6dcf4509ade3a24cbe7c61aed43a362445a 100644 (file)
@@ -350,6 +350,8 @@ public class AugmentationSchemaBuilderImpl implements AugmentationSchemaBuilder
                     + ((targetPath == null) ? 0 : targetPath.hashCode());
             result = prime * result
                     + ((whenCondition == null) ? 0 : whenCondition.hashCode());
+            result = prime * result
+                    + ((childNodes == null) ? 0 : childNodes.hashCode());
             return result;
         }
 
@@ -379,6 +381,13 @@ public class AugmentationSchemaBuilderImpl implements AugmentationSchemaBuilder
             } else if (!whenCondition.equals(other.whenCondition)) {
                 return false;
             }
+            if (childNodes == null) {
+                if (other.childNodes != null) {
+                    return false;
+                }
+            } else if (!childNodes.equals(other.childNodes)) {
+                return false;
+            }
             return true;
         }