我只是想不通是什么问题,为什么这段代码抛出java.util.NoSuchElementException,因为在下一个方法之前有hasNext叫
Map results = getResults();
if (results != null)
{
Set set = results.entrySet();
Iterator it = set.iterator();
while (it.hasNext()) {
Map.Entry entry = (Map.Entry) it.next();
Iterator jt = ((Collection) entry.getValue()).iterator();
while (jt.hasNext()) {
CustomException e = (CustomException) jt.next();
String exp = e.getMessage();
exp = (exp == null)?"":exp;
if(!"".equals(exp) && !exp.contains("errors"))
{
setError(exp)
}
}
}
}