findDataChildByName() provides a proper Optional-based interface,
use that instead of the deprecated method.
Change-Id: I7813e308f1fac5a07cfa9eba2f96e5df981378cf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
checkNotNull(module, "%s: Could not obtain the module schema for namespace %s, revision %s",
logName, bindingContext.bindingQName.getNamespace(), bindingContext.bindingQName.getRevision());
checkNotNull(module, "%s: Could not obtain the module schema for namespace %s, revision %s",
logName, bindingContext.bindingQName.getNamespace(), bindingContext.bindingQName.getRevision());
- DataSchemaNode dataSchema = module.getDataChildByName(bindingContext.bindingQName);
+ QName qname = bindingContext.bindingQName;
+ DataSchemaNode dataSchema = module.findDataChildByName(qname).orElseThrow(
+ () -> new ConfigXMLReaderException(logName + ": Could not obtain the schema for " + qname));
+
checkNotNull(dataSchema, "%s: Could not obtain the schema for %s", logName, bindingContext.bindingQName);
checkCondition(bindingContext.schemaType.isAssignableFrom(dataSchema.getClass()),
checkNotNull(dataSchema, "%s: Could not obtain the schema for %s", logName, bindingContext.bindingQName);
checkCondition(bindingContext.schemaType.isAssignableFrom(dataSchema.getClass()),