Fix of bug in FileUtil - do not empty the file if one tries to copy it into itself.

This commit is contained in:
Ivan Bessonov
2016-04-08 14:08:29 +03:00
parent f81b4d4303
commit 223ef9d742
@@ -459,6 +459,7 @@ public class FileUtil extends FileUtilRt {
@SuppressWarnings("Duplicates")
private static void performCopy(@NotNull File fromFile, @NotNull File toFile, final boolean syncTimestamp) throws IOException {
if (filesEqual(fromFile, toFile)) return;
final FileOutputStream fos;
try {
fos = openOutputStream(toFile);