From c63ea1bf2a5ecdec6f2bd379f7d06d73326e8954 Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Mon, 6 Oct 2014 17:16:29 +0400 Subject: [PATCH] no need to create tmp dir file every time --- .../util/src/com/intellij/openapi/util/io/FileUtil.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/util/src/com/intellij/openapi/util/io/FileUtil.java b/platform/util/src/com/intellij/openapi/util/io/FileUtil.java index 4324deee35d4..d7d632377ab4 100644 --- a/platform/util/src/com/intellij/openapi/util/io/FileUtil.java +++ b/platform/util/src/com/intellij/openapi/util/io/FileUtil.java @@ -383,10 +383,10 @@ public class FileUtil extends FileUtilRt { @Nullable private static File renameToTempFileOrDelete(@NotNull File file) { - final File tempDir = new File(getTempDirectory()); + String tempDir = getTempDirectory(); boolean isSameDrive = true; if (SystemInfo.isWindows) { - String tempDirDrive = tempDir.getAbsolutePath().substring(0, 2); + String tempDirDrive = tempDir.substring(0, 2); String fileDrive = file.getAbsolutePath().substring(0, 2); isSameDrive = tempDirDrive.equalsIgnoreCase(fileDrive); } @@ -405,7 +405,7 @@ public class FileUtil extends FileUtilRt { return null; } - private static File getTempFile(@NotNull String originalFileName, @NotNull File parent) { + private static File getTempFile(@NotNull String originalFileName, @NotNull String parent) { int randomSuffix = (int)(System.currentTimeMillis() % 1000); for (int i = randomSuffix; ; i++) { @NonNls String name = "___" + originalFileName + i + ASYNC_DELETE_EXTENSION;