AA: make paths platform-independent before using JRT file system

^KT-59697 Fixed
This commit is contained in:
Jinseong Jeon
2023-06-27 11:44:28 -07:00
committed by Ilya Kirillov
parent bf1c9774aa
commit 0d19a5b3ea
4 changed files with 12 additions and 7 deletions
@@ -6,6 +6,7 @@
package org.jetbrains.kotlin.analysis.api.impl.base.util
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.text.StringUtil
import com.intellij.openapi.vfs.StandardFileSystems
import com.intellij.openapi.vfs.VfsUtilCore
@@ -38,7 +39,7 @@ object LibraryUtils {
?.let { getAllVirtualFilesFromRoot(it, includeRoot) } ?: emptySet()
}
fun getAllPsiFilesFromTheJar(
fun getAllPsiFilesFromJar(
jar: Path,
project: Project,
jarFileSystem: CoreJarFileSystem = CoreJarFileSystem(),
@@ -116,7 +117,9 @@ object LibraryUtils {
val result = mutableListOf<String>()
if (isModularRuntime(jdkHome)) {
val jrtBaseUrl: String = StandardFileSystems.JRT_PROTOCOL_PREFIX + jdkHome.toString() + JAR_SEPARATOR
val jrtBaseUrl = "${StandardFileSystems.JRT_PROTOCOL_PREFIX}${
FileUtil.toSystemIndependentName(jdkHome.toAbsolutePath().toString())
}$JAR_SEPARATOR"
val modules = readModulesFromReleaseFile(jdkHome)
if (modules != null) {
for (module in modules) {