盡管使用synchronized,ConcurrentModificationExceptionpublic synchronized X getAnotherX(){
if(iterator.hasNext()){
X b = iterator.next();
String name = b.getInputFileName();
...
return b;
}
else{return null;}
}盡管聲明頭中的synchronized語句,我仍然在我使用iterator.next()的行中得到一個(gè)ConcurrentModificationException異常; 什么錯(cuò)了?
添加回答
舉報(bào)
0/150
提交
取消