UnsupportedOperationException in AbstractList.remove() when operating on ArrayList
问题 ArrayList 's list iterator does implement the remove method, however, I get the following exception thrown: UnsupportedOperationException at java.util.AbstractList.remove(AbstractList.java:144) By this code: protected void removeZeroLengthStringsFrom(List<String> stringList) { ListIterator<String> iter = stringList.listIterator(); String s; while (iter.hasNext()) { s = iter.next(); if (s.length() == 0) { iter.remove(); } } } What am I missing here? I have verified that the List<String> I am