Refactored base yang-java types.
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / util / CopyUtils.java
index 225b471a558bb3d3a7fe78e782e7bc57016102ff..f651e4c6af4dd991acc0a64fa4dce795fa3d05e7 100644 (file)
@@ -233,7 +233,7 @@ public class CopyUtils {
         if (old.getType() == null) {
             copy.setTypedef(copy(old.getTypedef(), copy, updateQName));
         } else {
-            copy.setType(ParserUtils.createCorrectTypeDefinition(copy.getPath(), old.getType()));
+            copy.setType(old.getType());
         }
 
         copy.setDefaultStr(old.getDefaultStr());
@@ -265,7 +265,7 @@ public class CopyUtils {
         if (old.getType() == null) {
             copy.setTypedef(copy(old.getTypedef(), copy, updateQName));
         } else {
-            copy.setType(ParserUtils.createCorrectTypeDefinition(copy.getPath(), old.getType()));
+            copy.setType(old.getType());
         }
 
         copy.setUserOrdered(old.isUserOrdered());
@@ -359,9 +359,8 @@ public class CopyUtils {
             UnionTypeBuilder oldUnion = (UnionTypeBuilder)old;
             type = new UnionTypeBuilder(newParent.getModuleName(), newParent.getLine());
             type.setParent(newParent);
-            type.setPath(newSchemaPath);
             for(TypeDefinition<?> td : oldUnion.getTypes()) {
-                type.setType(ParserUtils.createCorrectTypeDefinition(type.getPath(), td));
+                type.setType(td);
             }
             for(TypeDefinitionBuilder tdb : oldUnion.getTypedefs()) {
                 type.setTypedef(copy(tdb, type, updateQName));
@@ -379,7 +378,7 @@ public class CopyUtils {
             if (old.getType() == null) {
                 type.setTypedef(copy(old.getTypedef(), type, updateQName));
             } else {
-                type.setType(ParserUtils.createCorrectTypeDefinition(type.getPath(), old.getType()));
+                type.setType(old.getType());
             }
 
             for (UnknownSchemaNodeBuilder un : old.getUnknownNodeBuilders()) {