From: Ben Soares Date: Mon, 6 Jul 2020 14:43:37 +0000 (+0100) Subject: JAL-3628 Fix for slightly incorrect boolean usage to determine success when rolling... X-Git-Tag: Release_2_11_1_1~13^2~26^2~6^2~3^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=4f1c8f3fdd352d5e6c3e6cfe1b729f9ef7d6e47f;p=jalview.git JAL-3628 Fix for slightly incorrect boolean usage to determine success when rolling backup files --- diff --git a/src/jalview/io/BackupFiles.java b/src/jalview/io/BackupFiles.java index 4f86f3d..c41bd36 100644 --- a/src/jalview/io/BackupFiles.java +++ b/src/jalview/io/BackupFiles.java @@ -431,7 +431,9 @@ public class BackupFiles { if (previousFile != null) { - ret = ret && moveFileToFile(backupfile_n, previousFile); + // using boolean '&' instead of '&&' as don't want moveFileToFile + // attempt to be conditional (short-circuit) + ret = ret & moveFileToFile(backupfile_n, previousFile); } } @@ -549,7 +551,9 @@ public class BackupFiles suffix, digits); Cache.log.debug("BACKUPFILES Moving old file [" + file + "] to latestBackupFilename [" + latestBackupFilename + "]"); - ret |= moveFileToFile(file, new File(latestBackupFilename)); + // using boolean '&' instead of '&&' as don't want moveFileToFile attempt to + // be conditional (short-circuit) + ret = ret & moveFileToFile(file, new File(latestBackupFilename)); Cache.log.debug( "BACKUPFILES moving " + file + " to " + latestBackupFilename + " was " + (ret ? "" : "NOT ") + "successful");