Results 1 to 2 of 2
  1. #1
    mharsijamel is offline Member
    Join Date
    Aug 2011
    Posts
    60
    Rep Power
    0

    Default concurrent modification

    i want to know how to iterate a collection and make modification on it without having the exception of "concurrent modification"
    Java Code:
    public void créer_noeud(String name,String parent,Element noeud,String pari)
        {
                   .
                   . 
                   .  
                    List inds=noeud.getChildren();
                    ListIterator ind=inds.listIterator();
                    while(ind.hasNext())
                    {
                        Element ele=(Element) ind.next();
                        String par=ele.getName();
                        if(par.equals("X"))
                                System.out.println("X");
                        else
                                créer_noeud(name, parent,ele,pari);
                   }
       }
    Please help me

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default Re: concurrent modification

    Don't use an iterator. Use an old style for loop

Similar Threads

  1. JTable entry modification
    By lemontree45 in forum New To Java
    Replies: 1
    Last Post: 09-19-2011, 05:17 PM
  2. Modification in XML file
    By anurag_1226 in forum Java Software
    Replies: 1
    Last Post: 04-10-2010, 06:53 PM
  3. n00b: jTable gui modification
    By ankitmcgill in forum New To Java
    Replies: 1
    Last Post: 03-15-2009, 06:34 PM
  4. help with concurrent modification exception
    By jdgallag in forum New To Java
    Replies: 1
    Last Post: 11-30-2008, 09:19 PM
  5. Inventory Program modification help
    By badness in forum Java Applets
    Replies: 1
    Last Post: 01-17-2008, 05:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •