- final List<QName> newPath = new ArrayList<>();
-
- for (QName qn : augment.getTargetPath().getPathFromRoot()) {
- QNameModule qnm = module.getQNameModule();
- String localPrefix = qn.getPrefix();
- if (localPrefix != null && !localPrefix.isEmpty()) {
- ModuleBuilder currentModule = BuilderUtils.getModuleByPrefix(module, localPrefix);
- if (currentModule == null) {
- throw new YangParseException(module.getName(), augment.getLine(), "Module with prefix "
- + localPrefix + " not found.");
- }
- qnm = currentModule.getQNameModule();
- }
- newPath.add(QName.create(qnm, localPrefix, qn.getLocalName()));
- }
-
- /*
- * FIXME: this method of SchemaPath construction is highly ineffective.
- * It would be great if we could actually dive into the context,
- * find the actual target node and reuse its SchemaPath. Can we
- * do that?
- */
- newSchemaPath = SchemaPath.create(newPath, true);