Allan Andersen created XGC-120: ---------------------------------- Summary: java.util.ConcurrentModificationException in ImageImplregistry iterator Key: XGC-120 URL: https://issues.apache.org/jira/browse/XGC-120 Project: XMLGraphicsCommons Issue Type: Bug Affects Versions: 2.3 Environment: Ubuntu Reporter: Allan Andersen
I get this ConcurrentModificationException when running a multithreaded testcase. The problem is related to the preloaders (ArrayList) in ImageImplRegistry which isn't threadsafe. Using CopyOnWriteArrayList is a quick solution to the issue. The other lists/maps are using the same non-threadsafe implementations. CopyOnWriteArrayList and ConcurrentHashMap works better. {code:java} Stacktrace: Caused by: java.util.ConcurrentModificationException at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:909) at java.util.ArrayList$Itr.next(ArrayList.java:859) at org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry$MyIterator.next(ImageImplRegistry.java:267) at org.apache.xmlgraphics.image.loader.ImageManager.preloadImage(ImageManager.java:175) at org.apache.xmlgraphics.image.loader.cache.ImageCache.needImageInfo(ImageCache.java:127) at org.apache.xmlgraphics.image.loader.ImageManager.getImageInfo(ImageManager.java:123) at org.apache.fop.fo.flow.ExternalGraphic.bind(ExternalGraphic.java:81) at org.apache.fop.fo.FObj.processNode(FObj.java:126) at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:291) at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:179) at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1073) at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485) {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: general-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: general-h...@xmlgraphics.apache.org