if (destFile.exists()) {
<BUG>for (int retries = 0; retries < 100 && destFile.exists() && !compareFiles(tempFile, destFile); retries++) {
destFile = makeTempFile(dir, tempFile.getName(), retries);</BUG>
}
<BUG>}
return destFile;</BUG>
}
private File makeTempFile(File tempDir, String fname, int retries) {
if (retries != 0) {
String unique = Integer.toString(retries);

if (destFile.exists()) {
for (int retries = 0; retries < 100 && destFile.exists(); retries++) {
if (retries == 0 && compareFiles(tempFile, destFile, cb)) {
break;
}
destFile = makeTempFile(dir, tempFile.getName(), retries);
}
}
cb.setFinished();
return destFile;
}
private File makeTempFile(File tempDir, String fname, int retries) {
if (retries != 0) {
String unique = Integer.toString(retries);
