Skip to content

Commit

Permalink
[FIXED JENKINS-12987]
Browse files Browse the repository at this point in the history
To remove items from the list while iterating, we need to use Iterator explicitly
  • Loading branch information
kohsuke committed Mar 10, 2012
1 parent 1364c0e commit 8a4b5f6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/hudson/scm/CVSSCM.java
Expand Up @@ -56,6 +56,7 @@
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
Expand Down Expand Up @@ -356,9 +357,10 @@ protected PollingResult compareRemoteRevisionWith(final AbstractProject<?, ?> pr

// filter out all changes in the exclude regions
for (final Pattern excludePattern : excludePatterns) {
for (final CvsFile change : filteredChanges) {
for (Iterator<CvsFile> itr = filteredChanges.iterator(); itr.hasNext(); ) {
CvsFile change = itr.next();
if (excludePattern.matcher(change.getName()).matches()) {
filteredChanges.remove(change);
itr.remove();
}
}
}
Expand Down

0 comments on commit 8a4b5f6

Please sign in to comment.