diff --git a/src/com/sheepit/client/Client.java b/src/com/sheepit/client/Client.java index d03084b..4044029 100644 --- a/src/com/sheepit/client/Client.java +++ b/src/com/sheepit/client/Client.java @@ -536,8 +536,8 @@ public class Client { new_env.put("BLENDER_USER_CONFIG", this.config.workingDirectory.getAbsolutePath().replace("\\", "\\\\")); int index = 0; - for (int i = 0; i < command1.length; i++) { - if (command1[i].equals(".c")) { + for (String arg : command1) { + if (arg.equals(".c")) { command[index] = ajob.getScenePath(); index += 1; command[index] = "-P"; @@ -563,7 +563,7 @@ public class Client { } script_file.deleteOnExit(); } - else if (command1[i].equals(".e")) { + else if (arg.equals(".e")) { command[index] = ajob.getRendererPath(); // the number of cores has to be put after the binary and before the scene arg if (this.config.getNbCores() > 0) { @@ -574,14 +574,14 @@ public class Client { //index += 1; // do not do it, it will be done at the end of the loop } } - else if (command1[i].equals(".o")) { + else if (arg.equals(".o")) { command[index] = this.config.workingDirectory.getAbsolutePath() + File.separator + ajob.getPrefixOutputImage(); } - else if (command1[i].equals(".f")) { + else if (arg.equals(".f")) { command[index] = ajob.getFrameNumber(); } else { - command[index] = command1[i]; + command[index] = arg; } index += 1; } diff --git a/src/com/sheepit/client/Configuration.java b/src/com/sheepit/client/Configuration.java index 898acc4..fb58340 100644 --- a/src/com/sheepit/client/Configuration.java +++ b/src/com/sheepit/client/Configuration.java @@ -197,8 +197,7 @@ public class Configuration { File[] files = dir.listFiles(); if (files != null) { - for (int i = 0; i < files.length; i++) { - File file = files[i]; + for (File file : files) { if (file.isDirectory()) { Utils.delete(file); } diff --git a/src/com/sheepit/client/Error.java b/src/com/sheepit/client/Error.java index 1b4193a..fc78f23 100644 --- a/src/com/sheepit/client/Error.java +++ b/src/com/sheepit/client/Error.java @@ -82,9 +82,9 @@ public class Error { public static ServerCode fromInt(int val) { ServerCode[] As = ServerCode.values(); - for (int i = 0; i < As.length; i++) { - if (As[i].getValue() == val) { - return As[i]; + for (ServerCode A : As) { + if (A.getValue() == val) { + return A; } } return ServerCode.UNKNOWN; diff --git a/src/com/sheepit/client/Utils.java b/src/com/sheepit/client/Utils.java index 97d005a..0cc36aa 100644 --- a/src/com/sheepit/client/Utils.java +++ b/src/com/sheepit/client/Utils.java @@ -155,8 +155,8 @@ public class Utils { if (directory_.isDirectory()) { File[] list = directory_.listFiles(); if (list != null) { - for (int i = 0; i < list.length; i++) { - double max1 = lastModificationTime(list[i]); + for (File aFile : list) { + double max1 = lastModificationTime(aFile); if (max1 > max) { max = max1; }