coheigea commented on code in PR #3739:
URL: https://github.com/apache/cxf/pull/3739#discussion_r4614505548
##########
rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetUtils.java:
##########
@@ -226,6 +221,28 @@ protected String mapUri(Bus bus, String base, Map<String,
SchemaReference> smp,
return null;
}
+ /**
+ * Get the import key for a schema that can't be looked up directly. The
key already created for the
+ * schema is reused, so that serving the same document repeatedly doesn't
keep adding new keys to the
+ * map, which lives as long as the service.
+ */
+ private static String getImportKey(Map<String, SchemaReference> smp,
SchemaReference ref) {
+ synchronized (smp) {
Review Comment:
@reta I’ve removed the lock and claim the key with putIfAbsent instead,
which is atomic on the ConcurrentHashMap the schemas are stored in. That also
fixes a race the old code had: two schemas being served concurrently could be
given the same _importN.xsd key, so one link would serve the wrong schema.
--
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]