diff options
author | Carsten Hammer <carsten.hammer@t-online.de> | 2019-04-06 19:16:36 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2019-04-13 19:33:13 +0200 |
commit | 6e03645ad80adf71527ca18f937db4b8e34b7f13 (patch) | |
tree | 180b2049810f45b80af4268da6918cb5a94501b7 /org.eclipse.jgit.junit/src | |
parent | c0268f899e3e600a45f6c028f4d0088b2fb2fce1 (diff) | |
download | jgit-6e03645ad80adf71527ca18f937db4b8e34b7f13.tar.gz jgit-6e03645ad80adf71527ca18f937db4b8e34b7f13.zip |
Use jdk 5 for loop
Replace simple uses of Iterator with a corresponding for-loop.
Also add missing braces on loops as necessary.
Change-Id: I708d82acdf194787e3353699c07244c5ac3de189
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.junit/src')
-rw-r--r-- | org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java index 5bac342b0a..f93424ca14 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java @@ -235,17 +235,18 @@ public abstract class LocalDiskRepositoryTestCase { if (!dir.exists()) return silent; final File[] ls = dir.listFiles(); - if (ls != null) - for (int k = 0; k < ls.length; k++) { - final File e = ls[k]; - if (e.isDirectory()) - silent = recursiveDelete(e, silent, failOnError); - else if (!e.delete()) { - if (!silent) - reportDeleteFailure(failOnError, e); + if (ls != null) { + for (File f : ls) { + if (f.isDirectory()) { + silent = recursiveDelete(f, silent, failOnError); + } else if (!f.delete()) { + if (!silent) { + reportDeleteFailure(failOnError, f); + } silent = !failOnError; } } + } if (!dir.delete()) { if (!silent) reportDeleteFailure(failOnError, dir); |