Aklakan commented on code in PR #2925: URL: https://github.com/apache/jena/pull/2925#discussion_r1915180968
########## jena-arq/src/main/java/org/apache/jena/sparql/engine/binding/BindingBase.java: ########## @@ -202,4 +202,19 @@ public static int hashCode(Binding bind) { } return hash; } + + @Override + public Binding detach() { + Binding newParent = parent == null ? null : parent.detach(); + Binding result = newParent == parent + ? detachWithOriginalParent() + : detachWithNewParent(newParent); + return result; + } + + protected Binding detachWithOriginalParent() { + return this; + } + + protected abstract Binding detachWithNewParent(Binding newParent); Review Comment: I was also thinking that BindingFactory could take care of making bindings independent. But then again, why should BindingFactory have special logic for BindingTDB instances? In principle, `BindingTDB.detach` could be implemented as just setting filling the already present (but unused) cache - so no copy would be needed then. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: pr-unsubscr...@jena.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@jena.apache.org For additional commands, e-mail: pr-h...@jena.apache.org