我遇到了一个奇怪的问题。得到java.util.ConcurrentModificationException
. 但我没有修改当前的集合。请帮忙。
方法调用
setAllAddress((List<AddressBean>) usrProfileResp.getAddressBeanList());
setShippingAddresses(getAllAddress());
方法
public List<AddressBean> getAllAddress() {
return allAddress;
}
public void setShippingAddresses(List<AddressTokenBean> shippingAddresses) {
shippingAddresses = new ArrayList<AddressBean>();
List<AddressBean> addresses = getAllAddress();
if (addresses != null && addresses.size() > 0) {
for (AddressBean addr : addresses) { // EXCEPTION OCCURS HERE
if (!Constants.BILLING_ADDRESS.equals(addr.getAddressType())) {
shippingAddresses.add(addr);
}
}
}
}