Uploaded image for project: 'Batik'
  1. Batik
  2. BATIK-1049

when modifying the dom in updatemanger queue, I got java.util.ConcurrentModificationException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.7
    • Fix Version/s: None
    • Component/s: SVG DOM
    • Labels:
      None
    • Environment:
      jdk1.7.10 ubuntu 12.04 batik 1.7

      Description

      I got the exception when modifying the dom in updatemanger queue.
      But notice that : the exception is not always throwed, it really hard to catch that. we met twice, in about six monthes.

      code:
      WarnLevel wl = content.getLevel();
      Element textNode = doc.getElementById(elementId + "_bubble1_text");
      Element imgNode = doc.getElementById(elementId + "_bubble1_image");
      //this is the place where the error occur
      imgNode.setAttributeNS(SVGUtils.XLinkNameSpace, "xlink:href", "#" + wl.name() + "_gridnt_bubble");
      NodeList list = textNode.getChildNodes();
      int total = 0;
      for (String msg : msgs) {
      int temp = Integer.parseInt(msg);
      total += temp;
      }
      ((org.apache.batik.dom.GenericText) list.item(0)).setData(Integer.toString(total));

      exception:
      java.util.ConcurrentModificationException
      at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:819)
      at java.util.ArrayList$Itr.next(ArrayList.java:791)
      at org.apache.batik.dom.AbstractDocument.getChildElementById(AbstractDocument.java:482)
      at org.apache.batik.dom.AbstractDocument.getElementById(AbstractDocument.java:451)
      at org.apache.batik.bridge.URIResolver.getNode(URIResolver.java:116)
      at org.apache.batik.bridge.BridgeContext.getReferencedNode(BridgeContext.java:752)
      at org.apache.batik.bridge.BridgeContext.getReferencedElement(BridgeContext.java:796)
      at org.apache.batik.bridge.SVGUseElementBridge.buildCompositeGraphicsNode(SVGUseElementBridge.java:124)
      at org.apache.batik.bridge.SVGUseElementBridge.handleAnimatedAttributeChanged(SVGUseElementBridge.java:461)
      at org.apache.batik.bridge.BridgeContext$AnimatedAttrListener.animatedAttributeChanged(BridgeContext.java:1763)
      at org.apache.batik.dom.svg.SVGOMDocument$AnimAttrListener.animatedAttributeChanged(SVGOMDocument.java:706)
      at org.apache.batik.dom.svg.AbstractSVGAnimatedValue.fireAnimatedAttributeListeners(AbstractSVGAnimatedValue.java:132)
      at org.apache.batik.dom.svg.SVGOMAnimatedString.attrAdded(SVGOMAnimatedString.java:105)
      at org.apache.batik.dom.svg.AbstractElement.attrAdded(AbstractElement.java:228)
      at org.apache.batik.dom.AbstractElement.fireDOMAttrModifiedEvent(AbstractElement.java:621)
      at org.apache.batik.dom.svg.AbstractElement.fireDOMAttrModifiedEvent(AbstractElement.java:117)
      at org.apache.batik.dom.AbstractElement$NamedNodeHashMap.setNamedItem(AbstractElement.java:903)
      at org.apache.batik.dom.AbstractElement$NamedNodeHashMap.setNamedItemNS(AbstractElement.java:844)
      at org.apache.batik.dom.AbstractElement.setAttributeNS(AbstractElement.java:263)
      at com.gd.gui.svgjung.svg.util.SVGUtils.processWarn(SVGUtils.java:352)
      at com.gd.gui.svgjung.WarnRepaintDaemon$1.run(WarnRepaintDaemon.java:106)
      at org.apache.batik.util.RunnableQueue.run(RunnableQueue.java:237)
      at java.lang.Thread.run(Thread.java:722)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              angrysnail angrysnail
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: