diff --git a/java/compiler/impl/src/com/intellij/packaging/impl/compiler/ArtifactsCompilerInstance.java b/java/compiler/impl/src/com/intellij/packaging/impl/compiler/ArtifactsCompilerInstance.java index e93a68fed095..f719d740ee5f 100644 --- a/java/compiler/impl/src/com/intellij/packaging/impl/compiler/ArtifactsCompilerInstance.java +++ b/java/compiler/impl/src/com/intellij/packaging/impl/compiler/ArtifactsCompilerInstance.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2010 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -305,7 +305,7 @@ public class ArtifactsCompilerInstance extends GenericCompilerInstance createPathsHashSet() { - return new THashSet(FileUtil.T_HASHING_STRATEGY); + return new THashSet(FileUtil.PATH_HASHING_STRATEGY); } @Override 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 a8ab9439d248..149dbea1ac0f 100644 --- a/platform/util/src/com/intellij/openapi/util/io/FileUtil.java +++ b/platform/util/src/com/intellij/openapi/util/io/FileUtil.java @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package com.intellij.openapi.util.io; import com.intellij.CommonBundle; @@ -35,6 +34,7 @@ import org.intellij.lang.annotations.RegExp; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import org.jetbrains.util.rt.FileUtilRt; import java.io.*; import java.lang.reflect.Method; @@ -45,8 +45,21 @@ import java.util.regex.Pattern; @SuppressWarnings({"UtilityClassWithoutPrivateConstructor"}) public class FileUtil extends FileUtilLight { public static final int MEGABYTE = 1024 * 1024; + @NonNls public static final String ASYNC_DELETE_EXTENSION = ".__del__"; + public static final TObjectHashingStrategy PATH_HASHING_STRATEGY; + static { + if (SystemInfo.isFileSystemCaseSensitive) { + @SuppressWarnings({"unchecked", "UnnecessaryLocalVariable"}) + final TObjectHashingStrategy canonical = TObjectHashingStrategy.CANONICAL; + PATH_HASHING_STRATEGY = canonical; + } + else { + PATH_HASHING_STRATEGY = CaseInsensitiveStringHashingStrategy.INSTANCE; + } + } + private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.util.io.FileUtil"); private static final ThreadLocal BUFFER = new ThreadLocal() { @@ -57,13 +70,11 @@ public class FileUtil extends FileUtilLight { // do not use channels to copy files larger than 5 Mb because of possible MapFailed error private static final long CHANNELS_COPYING_LIMIT = 5L * MEGABYTE; - private static final int MAX_FILE_DELETE_ATTEMPTS = 10; - public static final Method JAVA_IO_FILESYSTEM_GET_BOOLEAN_ATTRIBUTES_METHOD; - public static final Object/* java.io.FileSystem */ JAVA_IO_FILESYSTEM; - public static final TObjectHashingStrategy T_HASHING_STRATEGY = SystemInfo.isFileSystemCaseSensitive - ? TObjectHashingStrategy.CANONICAL - : CaseInsensitiveStringHashingStrategy.INSTANCE; + private static final int MAX_FILE_DELETE_ATTEMPTS = 10; + + private static final Method JAVA_IO_FILESYSTEM_GET_BOOLEAN_ATTRIBUTES_METHOD; + private static final Object JAVA_IO_FILESYSTEM; // java.io.FileSystem @Nullable public static String getRelativePath(File base, File file) { diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/compiler/MavenResourceCompiler.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/compiler/MavenResourceCompiler.java index ca6c14b1ba73..d736683ad70d 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/compiler/MavenResourceCompiler.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/compiler/MavenResourceCompiler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -96,7 +96,7 @@ public class MavenResourceCompiler implements ClassPostProcessingCompiler { } private static Set createPathsSet() { - return new THashSet(FileUtil.T_HASHING_STRATEGY); + return new THashSet(FileUtil.PATH_HASHING_STRATEGY); } private void saveCache(final Project project) {