xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas DeWeese <Thomas.DeWe...@Kodak.com>
Subject Re: Concurrent Modification Exception
Date Mon, 12 Jan 2004 11:33:02 GMT
Ignacio Leon wrote:

> In a batik application, I am erasing an element and adding a new one (a
> move action).
> 
> When I do it with two different calls to
> "svgCanvas.getUpdateManager().getUpdateRunnableQueue().invokeLater(new
> Runnable(...))", one for erasing and one for adding, I get a Concurrent
> Modification Exception, more precisely:

    This seems to indicate that the modification is not 'completed'
when your runnable returns.  So for example if your runnable
signals another thread to make the modification and then returns,
this issue will arise (in fact it is a good way to ensure this
occurs as you have discovered).   The Runnable's run method
must not return until after you are done modifying the DOM.

     So it is fine if you make the modification in another thread
but the runnable must wait until that other thread is done
before it returns.

     If you feel the above has nothing to do with what your
application is doing then you will need to provide some
additional information about what you are doing (pseudo code
standalone example).  Also what version of Batik would be useful
to know.  There isn't anything special about moving elements
around I do it all the time.


> java.util.ConcurrentModificationException
> 	at java.util.HashMap$HashIterator.nextEntry(Unknown Source)
> 	at java.util.HashMap$KeyIterator.next(Unknown Source)
> 	at org.apache.batik.gvt.UpdateTracker.getDirtyAreas(Unknown
> Source)
> 	at org.apache.batik.bridge.UpdateManager.repaint(Unknown Source)
> 	at org.apache.batik.bridge.UpdateManager.runnableInvoked(Unknown
> Source)
> 	at org.apache.batik.util.RunnableQueue.runnableInvoked(Unknown
> Source)
> 	at org.apache.batik.util.RunnableQueue.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> 
> 
> If I try to do both actions (adding and erasing) in the same call to the
> update manager, I get this exception as well.
> I have to say that before calling the Update Manager I make sure that
> all the rendering it's done and that the Update Manager has started. I
> have put listeners on the Update Manager and this happens AFTER the
> "updateCompleted" listener. 
> 
> Anyone had this problem before?
> 
> Cheers,
> 
> Ignacio Leon
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Mime
View raw message