21,7 → 21,7 |
public class ImmortableNumberSearch { |
|
private static final String SIGNATURE = "Immortable Number Report File Version 2.0"; |
private static final String SIGNATURE_MINOR = "Iterator GenX Java (backup, selftest, int32) r16"; |
private static final String SIGNATURE_MINOR = "Iterator GenX Java (backup, selftest, int32) r17"; |
private static final String END_SIG = "END OF REPORT"; |
private static final int SOFTBREAK = 76; |
|
152,8 → 152,7 |
private void save(boolean integrityTest) throws SaveException { |
if (integrityTest) { |
if (!integryTest()) { |
throw new SaveException( |
"Integrity test failed. Will not save."); |
throw new SaveException("Integrity test failed. Will not save."); |
} |
} |
|
209,8 → 208,8 |
// Make backup |
|
new File(backupDir).mkdir(); |
String bak_filename = backupDir + "/immortal_" + timestamp_filename + "_" + (u+1) |
+ ".txt"; |
String bak_filename = backupDir + "/immortal_" + timestamp_filename |
+ "_" + (u + 1) + ".txt"; |
try { |
FileUtils.copyFile(new File(filename), new File(bak_filename)); |
} catch (IOException e) { |
252,11 → 251,12 |
u++; |
a.add(r % 10); |
|
cnt++; |
if (cnt % saveInterval == 0) { |
save(firstSave); |
firstSave = false; |
} |
} while (++cnt != amount); |
} while (cnt != amount); |
|
// Wir brauchen nicht zwei Mal zu speichern |
if (cnt-1 % saveInterval != 0) { |