variable declaration lost on merging ifs
cal101 opened this issue · 1 comments
cal101 commented
protected static void safeMove(final VFile sourceFile, final VFile targetFile, boolean deleteBeforeMove) {
- if (deleteBeforeMove && targetFile.exists()) {
- if (!targetFile.delete()) {
- boolean exists = targetFile.exists();
- throw new UncheckedApplicationException("file: " + targetFile + " cant be deleted"
- + " (file " + (exists ? "exists)" : "does not exist)")
-
- );
- }
+ if ((deleteBeforeMove && targetFile.exists()) && !targetFile.delete()) {
+ throw new UncheckedApplicationException("file: " + targetFile + " cant be deleted" + " (file " + (exists ? "exists)" : "does not exist)"));
}