Skip to content
Permalink
Browse files
[JENKINS-29211] foreach cycle with break would be more readable
  • Loading branch information
recena committed Jul 4, 2015
1 parent 73c3c5c commit 7b7b165e5f01ebb71d577f8c0b581bf822eb9888
Showing with 2 additions and 5 deletions.
  1. +2 −5 src/main/java/hudson/scm/PerJobCredentialStore.java
@@ -115,16 +115,13 @@ private Object writeReplace() {
CredentialsStore store = CredentialsProvider.lookupStores(project).iterator().next();
for (Map.Entry<String, Credential> e : credentials.entrySet()) {
StandardCredentials credential = descriptor.migrateCredentials(store, e.getKey(), e.getValue());
int i = 0;
boolean found = false;
ModuleLocation[] locations = ((SubversionSCM) project.getScm()).getLocations();
while (i < locations.length && !found) {
for (int i = 0; i < locations.length; i++) {
try {
if (e.getKey().contains(locations[i].getSVNURL().getHost())) {
locations[i].setCredentialsId(credential.getId());
found = true;
break;
}
i++;
} catch (SVNException ex) {
// Should not happen, but...
LOGGER.log(WARNING, "Repository location with a malformed URL: " + locations[i].remote, ex);

0 comments on commit 7b7b165

Please sign in to comment.