Skip to content
Permalink
Browse files

Merge pull request #22 from svogt/JENKINS-18329

[FIXED JENKINS-18329] - Prevent ConcurrentModificationException
  • Loading branch information
mc1arke committed Jul 2, 2013
2 parents b1f5341 + c59089b commit 839a9f84d88f9a6bdce09e915e47e0827dc94b84
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/main/java/hudson/scm/AbstractCvs.java
@@ -35,6 +35,7 @@
import hudson.remoting.VirtualChannel;
import hudson.scm.cvstagging.CvsTagAction;
import hudson.util.Secret;

import org.apache.commons.io.output.DeferredFileOutputStream;
import org.netbeans.lib.cvsclient.CVSRoot;
import org.netbeans.lib.cvsclient.Client;
@@ -70,6 +71,7 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Locale;
import java.util.Map;
import java.util.regex.Pattern;
@@ -507,15 +509,15 @@ protected PollingResult compareRemoteRevisionWith(final AbstractProject<?, ?> pr
// update the remote state with the changes we've just retrieved
for (CvsFile changedFile : changes) {
boolean changed = false;
for (Iterator<CvsFile> itr = remoteFiles.iterator(); itr.hasNext();) {
for (ListIterator<CvsFile> itr = remoteFiles.listIterator(); itr.hasNext();) {
CvsFile existingFile = itr.next();
if (!changedFile.getName().equals(existingFile.getName())) {
continue;
}

remoteFiles.remove(existingFile);
itr.remove();
if (!changedFile.isDead()) {
remoteFiles.add(changedFile);
itr.add(changedFile);
}
changed = true;
}

0 comments on commit 839a9f8

Please sign in to comment.
You can’t perform that action at this time.