On Thu, Apr 17, 2025 at 12:18 PM Fred Hauschel <i...@hauschel.de> wrote: > > Hi there, in my opinion this is a bug: > > * > https://github.com/apache/commons-rdf/blob/006fbc3e47003c2d0fe8eb055f60f7cb267e1321/commons-rdf-rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/ModelGraphImpl.java#L142 > * > https://github.com/apache/commons-rdf/blob/006fbc3e47003c2d0fe8eb055f60f7cb267e1321/commons-rdf-rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/ModelGraphImpl.java#L150 > > Because nobody expects a parallel stream to be created and returned when > stream() is called. > There is also a great danger that this parallel stream will be used to > perform write operations with RDF4J. However, RDF4J is not thread-safe > and this can lead to non-deterministic results. > > What is your opinion on this?
Hello Fredy, At first glance, I would say that a Java stream() implementation that internally calls parallelStream() seems questionable unless explicitly documented. Let's wait and see if Stian Soiland-Reyes replies to this thread since he authored at least one of these methods. TY, Gary > > Thanks Fredy --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org