ConcurrentModificationException when using iterator and iterator.remove()
问题 private int checkLevel(String bigWord, Collection<String> dict, MinMax minMax) { /*value initialised to losing*/ int value = 0; if (minMax == MinMax.MIN) value = 1; else value = -1; boolean go = true; Iterator<String> iter = dict.iterator(); while(iter.hasNext()) { String str = iter.next(); Collection<Integer> inds = naiveStringSearch(bigWord, str); if(inds.isEmpty()) { iter.remove(); } for (Integer i : inds) { MinMax passin = minMax.MIN; if (minMax == MinMax.MIN) passin = minMax.MAX; int