[jdom-interest] java.util.ConcurrentModificationException
X.P.Pratibha :-)
xp_pratibha at HotPOP.com
Thu Jun 9 05:36:05 PDT 2005
Hi all,
I am having a ListIterator to traverse my JDOM. When I find a
list of my interest I am removing it using remove()...Its throwing
ConcurrentModificationException..Any thoughts will be of great help.
Please tell me whats going wrong???
while(listxpp.hasNext())
{
int removecount=0;
Element FWnode = ((Element)
listxpp.next()).getChild("FirewallRule");
String ID =FWnode.getAttributeValue("id");
while(listxpp2.hasNext())
{
Element FWnode2 = ((Element) listxpp2.next()).getChild("FirewallRule");
String ID2 = FWnode2.getAttributeValue("id");
if(ID.equals(ID2))
{
removecount++;
if(removecount>1)
{
listxpp2.remove();
}
}
}
while(listxpp2.hasPrevious()){
Element PWnode = ((Element)
listxpp2.previous()).getChild("FirewallRule");
}
}
More information about the jdom-interest
mailing list