Improved sorting of augmentations before code generation.
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / util / CopyUtils.java
index 4ab49fea230e960cbc475d6d932a03096ba4d7aa..2b3e29bb7faf95abe89cf257a24835f4da7267f6 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.yangtools.yang.parser.util;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
@@ -404,7 +403,7 @@ public final class CopyUtils {
 
     private static AugmentationSchemaBuilder copyAugment(final AugmentationSchemaBuilder old, final Builder newParent) {
         AugmentationSchemaBuilderImpl copy = new AugmentationSchemaBuilderImpl(newParent.getModuleName(),
-                newParent.getLine(), old.getTargetPathAsString());
+                newParent.getLine(), old.getTargetPathAsString(), old.getOrder());
         copy.setParent(newParent);
         copy.setCopyOf(old);
         copy.setDescription(old.getDescription());
@@ -491,7 +490,7 @@ public final class CopyUtils {
             }
         }
 
-        SchemaPath newSchemaPath = new SchemaPath(newPath, true);
+        SchemaPath newSchemaPath = SchemaPath.create(newPath, true);
         return new DataBean(newQName, newSchemaPath);
     }