mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-CR-69839 followup: change the equals algorithm - handle comparing "C:/temp/file.txt" to "c:/temp/file.txt" correctly
GitOrigin-RevId: a5ecc20498f0ac53e6fdda4d63c42dfb15aae145
This commit is contained in:
committed by
intellij-monorepo-bot
parent
bcc8649f6f
commit
dd87fe5a6a
@@ -22,6 +22,7 @@ import org.jetbrains.annotations.SystemIndependent;
|
||||
import java.io.File;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Objects;
|
||||
|
||||
public class LocalFilePath implements FilePath {
|
||||
@NotNull
|
||||
@@ -57,7 +58,9 @@ public class LocalFilePath implements FilePath {
|
||||
if (!CaseInsensitiveStringHashingStrategy.INSTANCE.equals(myPath, path.myPath)) return false;
|
||||
// make sure to not query (expensive) getVirtualFile() until it's absolutely necessary, e.g. we encountered two file paths differ by case only
|
||||
VirtualFile file = getVirtualFile();
|
||||
return file == null ? !SystemInfo.isFileSystemCaseSensitive : !file.isCaseSensitive();
|
||||
VirtualFile oFile = path.getVirtualFile();
|
||||
if (file == null && oFile == null) return !SystemInfo.isFileSystemCaseSensitive;
|
||||
return Objects.equals(file, oFile);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user