reta commented on code in PR #3350:
URL: https://github.com/apache/cxf/pull/3350#discussion_r3692635318
##########
rt/frontend/simple/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java:
##########
@@ -979,7 +979,15 @@ public Node cloneNode(Document document, Node node,
boolean deep) throws DOMExce
int type = node.getNodeType();
if (node.getOwnerDocument() == document) {
- return node.cloneNode(deep);
+ // The schema/WSDL Document backing this node may be cached and
shared across
+ // concurrent createClient() calls (see WSDLManagerImpl). The
native cloneNode(true)
+ // walk triggers UserDataHandler callbacks (e.g.
StaxUtils$LocationUserDataHandler)
+ // that mutate the source document's internal userData table,
which is not
+ // thread-safe (WeakHashMap in Xerces-J, HashMap in the JDK DOM
impl). Concurrent
+ // clones of the same shared document must therefore be serialized
(CXF-9234).
+ synchronized (document) {
Review Comment:
Thanks @ffang , I am wondering - could we make this method (`cloneNode`)
private? It seems to be used internally only, so the `synchronized` will be
enforced properly,
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]