在对Collection对象内容删除的操作时,
出现该异常,修改后,实现功能
public EmployeeBO getBoByIDCardYearMonth(List col,String IDCard)
{
EmployeeBO bo= new EmployeeBOImpl();
//EmployeeBO bo =new EmployeeBOImpl();
for(Iterator iter=col.iterator();iter.hasNext();)
{
EmployeeVO obj=(EmployeeVO)iter.next();
if(obj.getIDCard().equals(IDCard))
{
//bo.setEmployeeID(obj.getEmployeeID());
try {
BeanUtils.copyProperties(bo,obj);
iter.remove();
//col.remove(obj);
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
return bo;
}
{
EmployeeBO bo= new EmployeeBOImpl();
//EmployeeBO bo =new EmployeeBOImpl();
for(Iterator iter=col.iterator();iter.hasNext();)
{
EmployeeVO obj=(EmployeeVO)iter.next();
if(obj.getIDCard().equals(IDCard))
{
//bo.setEmployeeID(obj.getEmployeeID());
try {
BeanUtils.copyProperties(bo,obj);
iter.remove();
//col.remove(obj);
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
return bo;
}