-
Enhancement
-
Resolution: Unresolved
-
P4
-
8, 11, 17, 23, 24, 25
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
The method javax.imageio.spi.IIORegistry.getDefaultInstance() is not thread safe. If there are 2 threads that call this on start time there can be 2 instances of the default IIORegistry. If both thread register an ImageReaderSpi and/or ImageWriterSpi this can result in the sporadic lost of the registered objects:
Suggested solution is to synchronized the creation:
if (registry == null) {
synchronized (context) {
registry = (IIORegistry)context.get(IIORegistry.class);
if (registry == null) {
// Create an instance for this AppContext
registry = new IIORegistry();
context.put(IIORegistry.class, registry);
}
}
}