LOG.debug("Materializing child {} from {}", qname, templateQName);
final StmtContext<?, ?, ?> template;
- if (prototype instanceof InferredStatementContext) {
+ if (prototype instanceof InferredStatementContext<?, ?, ?> inferredPrototype) {
// Note: we need to access namespace here, as the target statement may have already been populated, in which
// case we want to obtain the statement in local namespace storage.
- template = ((InferredStatementContext<?, ?, ?>) prototype).getFromNamespace(ParserNamespaces.schemaTree(),
- templateQName);
+ template = inferredPrototype.getFromNamespace(ParserNamespaces.schemaTree(), templateQName);
} else {
template = prototype.allSubstatementsStream()
.filter(stmt -> stmt.producesEffective(SchemaTreeEffectiveStatement.class)