[jdom-interest] Pb with ConcurrentModificationException

Pellat, Dominique dominique.pellat at eds.com
Fri Jul 4 00:41:29 PDT 2003


I found a pb in JDOMb9 about the checkForComodification() method in
AbstractList :

I first created an instance of Document:

            domDataFile = builder.build("FichierLocal.xml");
	and use XMLOutputter after.

I then send domDataFile to another method in order to get the attributes,
detach them and create a new Attribute List :

      Element racineDataFile = domDataFile.getRootElement();
      // liste des attributs de la racine :
      List attrsRootDataFile = racineDataFile.getAttributes();
      List attrsRootDataFileFree = new ArrayList();
      for (Iterator i=attrsRootDataFile.iterator(); i.hasNext(); ) {
Exception-->     	 Attribute attr = (Attribute)i.next();
		 System.out.println("DataFile/attr :"+attr.getName());
		 attr.detach();
		 attrsRootDataFileFree.add(attr);
      }

Then I get :
java.util.ConcurrentModificationException
 	at
java.util.AbstractList$Itr.checkForComodification(AbstractList.java:448)
 	at java.util.AbstractList$Itr.next(AbstractList.java:419)
 	at maquette.Access_Data.LectureDonnees(Access_Data.java:186)

When using JDOMb7 the problem did not appear. Do you have an idea (about the
modCount management in AbstractList class) ?


Dominique



More information about the jdom-interest mailing list