List<UpImage> list = upfileDao.getAllImage();
List<UpImage> list1 = new ArrayList<UpImage>();
Iterator<UpImage> it = list.iterator();
while(it.hasNext()){
if(it.next().getSavepath2()==null||it.next().getSavepath2()==""){
list1.add(it.next());
}
}
list.removeAll(list1);
ActionContext.getContext().put("list", list);
java.util.NoSuchElementException
java.util.AbstractList$Itr.next(AbstractList.java:350)
应该是说不能用 list1.add(it.next())的it.next;
那应该怎么写法才对? |