//this returns module with the newest revision if more then 1 module with same namespace is found
private Optional<Module> getModule(final URI namespaceURI) {
- return Optional.fromJavaUtil(schemaContext.getCurrentContext().findModule(namespaceURI));
+ return Optional.fromJavaUtil(schemaContext.getCurrentContext().findModules(namespaceURI).stream().findFirst());
}
private static Optional<RpcDefinition> getRpcDefinitionFromModule(final Module module, final URI namespaceURI,
@Nonnull final SchemaPath type, @Nullable final NormalizedNode<?, ?> input) {
final Collection<DataContainerChild<? extends PathArgument, ?>> children =
(Collection<DataContainerChild<? extends PathArgument, ?>>) input.getValue();
- final Module module = schemaContext.findModule(type.getLastComponent().getNamespace()).orElse(null);
+ final Module module = schemaContext.findModules(type.getLastComponent().getNamespace()).stream()
+ .findFirst().orElse(null);
final RpcDefinition rpcDefinition = getRpcDefinitionFromModule(
module, module.getNamespace(), type.getLastComponent().getLocalName());
final ContainerSchemaNode outputSchemaNode = rpcDefinition.getOutput();