Browse Source

Merge "Cleanup curly braces"

stable-1.1
Christian Halstrick 14 years ago committed by Code Review
parent
commit
9ea9537d7c
  1. 25
      org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java

25
org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java

@ -217,29 +217,23 @@ public abstract class LocalDiskRepositoryTestCase {
private static boolean recursiveDelete(final String testName, private static boolean recursiveDelete(final String testName,
final File dir, boolean silent, boolean failOnError) { final File dir, boolean silent, boolean failOnError) {
assert !(silent && failOnError); assert !(silent && failOnError);
if (!dir.exists()) { if (!dir.exists())
return silent; return silent;
}
final File[] ls = dir.listFiles(); final File[] ls = dir.listFiles();
if (ls != null) { if (ls != null)
for (int k = 0; k < ls.length; k++) { for (int k = 0; k < ls.length; k++) {
final File e = ls[k]; final File e = ls[k];
if (e.isDirectory()) { if (e.isDirectory())
silent = recursiveDelete(testName, e, silent, failOnError); silent = recursiveDelete(testName, e, silent, failOnError);
} else { else if (!e.delete()) {
if (!e.delete()) { if (!silent)
if (!silent) { reportDeleteFailure(testName, failOnError, e);
reportDeleteFailure(testName, failOnError, e); silent = !failOnError;
}
silent = !failOnError;
}
} }
} }
}
if (!dir.delete()) { if (!dir.delete()) {
if (!silent) { if (!silent)
reportDeleteFailure(testName, failOnError, dir); reportDeleteFailure(testName, failOnError, dir);
}
silent = !failOnError; silent = !failOnError;
} }
return silent; return silent;
@ -447,9 +441,8 @@ public abstract class LocalDiskRepositoryTestCase {
private static String[] toEnvArray(final Map<String, String> env) { private static String[] toEnvArray(final Map<String, String> env) {
final String[] envp = new String[env.size()]; final String[] envp = new String[env.size()];
int i = 0; int i = 0;
for (Map.Entry<String, String> e : env.entrySet()) { for (Map.Entry<String, String> e : env.entrySet())
envp[i++] = e.getKey() + "=" + e.getValue(); envp[i++] = e.getKey() + "=" + e.getValue();
}
return envp; return envp;
} }

Loading…
Cancel
Save