xmlgraphics-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 47868] New: ConcurrentModificationException in ImageCache.doInvalidURIHouseKeeping()
Date Fri, 18 Sep 2009 10:31:15 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=47868

           Summary: ConcurrentModificationException in
                    ImageCache.doInvalidURIHouseKeeping()
           Product: XMLGraphicsCommons
           Version: Trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Image codecs
        AssignedTo: general@xmlgraphics.apache.org
        ReportedBy: mercuron@gmx.ch


If an Image in org/apache/xmlgraphics/image/loader/cache/ImageCache.java
expires a ConcurrentModificationException will be thrown.

The cause is method "private void doInvalidURIHouseKeeping()" which loops over
the Map "this.invalidURIs" and then tries to remove an element from this map in
method "private boolean removeInvalidURIIfExpired(String uri, long timestamp)".


To reproduce the error you can add the following method to ImageCacheTestCase.

    public void testImageCacheHouseKeeping() {
        ImageCache imageCache = new ImageCache(new TimeStampProvider(), new
DefaultExpirationPolicy(1));
        imageCache.registerInvalidURI("invalid");
        imageCache.registerInvalidURI("invalid2");
        try {
            Thread.sleep(1200);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        imageCache.doHouseKeeping();
    }

Stacktrace:
Caused by: java.util.ConcurrentModificationException
    at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793)
    at java.util.HashMap$EntryIterator.next(HashMap.java:834)
    at java.util.HashMap$EntryIterator.next(HashMap.java:832)
    at
org.apache.xmlgraphics.image.loader.cache.ImageCache.doInvalidURIHouseKeeping(ImageCache.java:294)
    at
org.apache.xmlgraphics.image.loader.cache.ImageCache.doHouseKeeping(ImageCache.java:287)
    at
org.apache.xmlgraphics.image.loader.cache.ImageCache.considerHouseKeeping(ImageCache.java:277)
    at
org.apache.xmlgraphics.image.loader.cache.ImageCache.registerInvalidURI(ImageCache.java:206)
    at
org.apache.xmlgraphics.image.loader.cache.ImageCache.needImageInfo(ImageCache.java:129)
    at
org.apache.xmlgraphics.image.loader.ImageManager.getImageInfo(ImageManager.java:112)
    at org.apache.fop.fo.flow.ExternalGraphic.bind(ExternalGraphic.java:81)
    at org.apache.fop.fo.FObj.processNode(FObj.java:123)
    at
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:282)
    at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:171)
    at
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
    at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
    at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source)
    at org.apache.xerces.xinclude.XIncludeHandler.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.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


Mime
View raw message