Path hash code is case-agnostic. This is to avoid changing it if e.g. path to project is reconfigured from C:\Work to c:\work
This commit is contained in:
+1
-4
@@ -41,10 +41,7 @@ import static org.jetbrains.kotlin.load.kotlin.PackageClassUtils.getPackageClass
|
||||
|
||||
public class PackagePartClassUtils {
|
||||
public static int getPathHashCode(@NotNull VirtualFile file) {
|
||||
// Conversion to system-dependent name seems to be unnecessary, but it's hard to check now:
|
||||
// it was introduced when fixing KT-2839, which appeared again (KT-3639).
|
||||
// If you try to remove it, run tests on Windows.
|
||||
return FileUtil.toSystemDependentName(file.getPath()).hashCode();
|
||||
return file.getPath().toLowerCase().hashCode();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+4
@@ -24,6 +24,10 @@ public class IncrementalProjectPathCaseChangedTest : AbstractIncrementalJpsTest(
|
||||
doTest("jps-plugin/testData/incremental/custom/projectPathCaseChanged/")
|
||||
}
|
||||
|
||||
fun testProjectPathCaseChangedMultiFile() {
|
||||
doTest("jps-plugin/testData/incremental/custom/projectPathCaseChangedMultiFile/")
|
||||
}
|
||||
|
||||
override fun doTest(testDataPath: String) {
|
||||
if (SystemInfoRt.isFileSystemCaseSensitive) {
|
||||
return
|
||||
|
||||
@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.jps.build;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.io.FileUtilRt;
|
||||
import com.intellij.testFramework.LightVirtualFile;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
@@ -614,8 +615,8 @@ public class KotlinJpsBuildTest extends AbstractKotlinJpsBuildTestCase {
|
||||
}
|
||||
|
||||
private String packagePartClass(String moduleName, String fileName, String packageClassFqName) {
|
||||
File file = new File(workDir, fileName);
|
||||
LightVirtualFile fakeVirtualFile = new LightVirtualFile(file.getPath()) {
|
||||
String path = FileUtilRt.toSystemIndependentName(new File(workDir, fileName).getAbsolutePath());
|
||||
LightVirtualFile fakeVirtualFile = new LightVirtualFile(path) {
|
||||
@NotNull
|
||||
@Override
|
||||
public String getPath() {
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
fun bar() {
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
Cleaning output files:
|
||||
out/production/module/_DefaultPackage$foo$*.class
|
||||
out/production/module/_DefaultPackage.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/foo.kt
|
||||
End of files
|
||||
@@ -0,0 +1,2 @@
|
||||
fun foo() {
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
fun foo() {
|
||||
}
|
||||
Reference in New Issue
Block a user