mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-03-06 12:20:56 +01:00
Synchronize jaxb context generation
This commit is contained in:
committed by
SCM-Manager
parent
dda52b8400
commit
e74225e168
2
gradle/changelog/jaxb_context_creation.yaml
Normal file
2
gradle/changelog/jaxb_context_creation.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
- type: fixed
|
||||
description: Concurrent modification exception in JAXB stores
|
||||
@@ -48,8 +48,11 @@ final class TypedStoreContext<T> {
|
||||
}
|
||||
|
||||
static <T> TypedStoreContext<T> of(TypedStoreParameters<T> parameters) {
|
||||
JAXBContext jaxbContext = contextCache.computeIfAbsent(parameters.getType(), type -> createJaxbContext(parameters));
|
||||
return new TypedStoreContext<>(jaxbContext, parameters);
|
||||
JAXBContext jaxbContext;
|
||||
synchronized (contextCache) {
|
||||
jaxbContext = contextCache.computeIfAbsent(parameters.getType(), type -> createJaxbContext(parameters));
|
||||
}
|
||||
return new TypedStoreContext<>(jaxbContext, parameters);
|
||||
}
|
||||
|
||||
private static <T> JAXBContext createJaxbContext(TypedStoreParameters<T> parameters) {
|
||||
|
||||
Reference in New Issue
Block a user