C koi cette exeption ?? java.util.ConcurrentModificati onException

C koi cette exeption ?? java.util.ConcurrentModificati onException - Java - Programmation

Marsh Posté le 15-10-2002 à 17:53:51    

Voila ce kil me pose l'animal ds mes tours de Hanoi
 
Exception occurred during event dispatching:
 
java.util.ConcurrentModificationException
 
 at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:445)
 
 at java.util.AbstractList$Itr.next(AbstractList.java:422)
 
 at hanoi.hanoi_princ.paint(hanoi_princ.java:124)
 
 at sun.awt.RepaintArea.paint(RepaintArea.java:298)
 
 at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:193)
 
 at java.awt.Component.dispatchEventImpl(Component.java:2665)
 
 at java.awt.Container.dispatchEventImpl(Container.java:1213)
 
 at java.awt.Component.dispatchEvent(Component.java:2499)
 
 at java.awt.EventQueue.dispatchEvent(EventQueue.java:319)
 
 at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:103)
 
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
 
 at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)
 
apparement il veux pas de mon integer mais c une fois qd ca lui prend


---------------
Philips HUE || Ikea Hack
Reply

Marsh Posté le 15-10-2002 à 17:53:51   

Reply

Marsh Posté le 15-10-2002 à 17:59:52    

Tu as 2 threads qui essaient de modifier la même collection en même temps (enfin, en l'occurrence, via un itérateur, si je comprends bien ta pile).
 
Pour éviter ça, tu dois rendre ta collection synchronisée. Rien de plus facile. Juste après l'avoir créée, tu fais :

Code :
  1. myList = Collections.synchronizedList(myList);


Sachant que la classe Collections se trouve dans le package java.util.


Message édité par BifaceMcLeOD le 15-10-2002 à 18:00:32
Reply

Marsh Posté le 15-10-2002 à 18:02:10    

Non en fait g trouvé


---------------
Philips HUE || Ikea Hack
Reply

Marsh Posté le 15-10-2002 à 18:30:44    

popol_55 a écrit a écrit :

Non en fait g trouvé




 [:zjk] ha ba cé cool alors !!! [:zjk]

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed