From bf62877e2b0de5df2983220c700ca84daeb975e6 Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Thu, 17 May 2012 20:16:55 +0400 Subject: [PATCH] Replaced Usage of PathUtil.jarFileToVirtualFile() to PathUtil.jarFileOrDirectoryToVirtualFile(), removed the former. --- .../jet/lang/resolve/java/CompilerDependencies.java | 4 ++-- compiler/util/src/org/jetbrains/jet/utils/PathUtil.java | 8 -------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/CompilerDependencies.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/CompilerDependencies.java index 226771fe4b5..fd6abaa85d0 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/CompilerDependencies.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/CompilerDependencies.java @@ -85,7 +85,7 @@ public class CompilerDependencies { @NotNull public List 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 getRuntimeRoots() { if (compilerSpecialMode.includeKotlinRuntime()) { - return Collections.singletonList(PathUtil.jarFileToVirtualFile(runtimeJar)); + return Collections.singletonList(PathUtil.jarFileOrDirectoryToVirtualFile(runtimeJar)); } else { return Collections.emptyList(); diff --git a/compiler/util/src/org/jetbrains/jet/utils/PathUtil.java b/compiler/util/src/org/jetbrains/jet/utils/PathUtil.java index cfb151927e2..7e8f472d756 100644 --- a/compiler/util/src/org/jetbrains/jet/utils/PathUtil.java +++ b/compiler/util/src/org/jetbrains/jet/utils/PathUtil.java @@ -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()) {