Issue Provide SPI interfaces to locate descriptors and JCas classes
Synchronize access to UCL cache
@@ -1762,13 +1762,14 @@ public abstract class FSClassRegistry { // abstract to prevent instantiating; th
// CL. This is in particular an issue for classes loaded through the SPI mechanism.
UIMAClassLoader ucl;
if (!(cl instanceof UIMAClassLoader)) {
+ synchronized (cl_to_uimaCl) {
ucl = cl_to_uimaCl.get(cl);
if (ucl == null) {
ucl = new UIMAClassLoader(NO_URLS, cl);
cl_to_uimaCl.put(cl, ucl);
}
}
- else {
+ } else {
ucl = (UIMAClassLoader) cl;
}
