Replaced Usage of PathUtil.jarFileToVirtualFile() to PathUtil.jarFileOrDirectoryToVirtualFile(), removed the former.
This commit is contained in:
+2
-2
@@ -85,7 +85,7 @@ public class CompilerDependencies {
|
||||
@NotNull
|
||||
public List<VirtualFile> getJdkHeaderRoots() {
|
||||
if (compilerSpecialMode.includeJdkHeaders()) {
|
||||
return Collections.singletonList(PathUtil.jarFileToVirtualFile(jdkHeadersJar));
|
||||
return Collections.singletonList(PathUtil.jarFileOrDirectoryToVirtualFile(jdkHeadersJar));
|
||||
}
|
||||
else {
|
||||
return Collections.emptyList();
|
||||
@@ -95,7 +95,7 @@ public class CompilerDependencies {
|
||||
@NotNull
|
||||
public List<VirtualFile> getRuntimeRoots() {
|
||||
if (compilerSpecialMode.includeKotlinRuntime()) {
|
||||
return Collections.singletonList(PathUtil.jarFileToVirtualFile(runtimeJar));
|
||||
return Collections.singletonList(PathUtil.jarFileOrDirectoryToVirtualFile(runtimeJar));
|
||||
}
|
||||
else {
|
||||
return Collections.emptyList();
|
||||
|
||||
@@ -118,14 +118,6 @@ public class PathUtil {
|
||||
return roots;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static VirtualFile jarFileToVirtualFile(@NotNull File file) {
|
||||
if (!file.exists() || !file.isFile()) {
|
||||
throw new IllegalStateException("file must exist and be regular to be converted to virtual file: " + file);
|
||||
}
|
||||
return VirtualFileManager.getInstance().findFileByUrl("jar://" + file.getPath() + "!/");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static VirtualFile jarFileOrDirectoryToVirtualFile(@NotNull File file) {
|
||||
if (file.exists()) {
|
||||
|
||||
Reference in New Issue
Block a user