AntiOurs
5 Jan 2011, 8:16 AM
I'm trying to remove an element from a list of BaseModel but I'm getting a java.util.ConcurrentModificationException.
Is there a Bug here or am I doing something wrong ?
- GXT 2.2.1
- Linux Ubuntu 10.10
- Firefox 3.6
- Hosted mode
Note : BeanGXTMagasin extends BaseModel
public void onSuccess(final List<BeanGXTMagasin> magasins) {
final ListStore<BeanGXTMagasin> store = new ListStore<BeanGXTMagasin>();
store.add(magasins);
[...]
for (BeanGXTMagasin bean : magasins) { //*** java.util.ConcurrentModificationException: null
if (bean.getFlagModif().equals("U")) {
magasins.get(magasins.indexOf(bean)).setFlagModif("N");
} else if (bean.getFlagModif().equals("I")) {
magasins.get(magasins.indexOf(bean)).setFlagModif("N");
} else if (bean.getFlagModif().equals("D")) {
magasins.remove(bean); //*** when this fired at the previous iteration
}
}
[...]
Is there a Bug here or am I doing something wrong ?
- GXT 2.2.1
- Linux Ubuntu 10.10
- Firefox 3.6
- Hosted mode
Note : BeanGXTMagasin extends BaseModel
public void onSuccess(final List<BeanGXTMagasin> magasins) {
final ListStore<BeanGXTMagasin> store = new ListStore<BeanGXTMagasin>();
store.add(magasins);
[...]
for (BeanGXTMagasin bean : magasins) { //*** java.util.ConcurrentModificationException: null
if (bean.getFlagModif().equals("U")) {
magasins.get(magasins.indexOf(bean)).setFlagModif("N");
} else if (bean.getFlagModif().equals("I")) {
magasins.get(magasins.indexOf(bean)).setFlagModif("N");
} else if (bean.getFlagModif().equals("D")) {
magasins.remove(bean); //*** when this fired at the previous iteration
}
}
[...]