diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/kotlin/KotlinBinaryClassCache.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/kotlin/KotlinBinaryClassCache.java index 7af5a65681d..e257fdf9476 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/kotlin/KotlinBinaryClassCache.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/kotlin/KotlinBinaryClassCache.java @@ -16,6 +16,7 @@ package org.jetbrains.jet.lang.resolve.kotlin; +import com.intellij.ide.highlighter.JavaClassFileType; import com.intellij.openapi.Disposable; import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.util.Ref; @@ -45,6 +46,8 @@ public final class KotlinBinaryClassCache implements Disposable { @Nullable public static KotlinJvmBinaryClass getKotlinBinaryClass(@NotNull VirtualFile file) { + if (file.getFileType() != JavaClassFileType.INSTANCE) return null; + KotlinBinaryClassCache service = ServiceManager.getService(KotlinBinaryClassCache.class); return service.cache.get().get(file).get(); } diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/kotlin/VirtualFileKotlinClassFinder.kt b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/kotlin/VirtualFileKotlinClassFinder.kt index 391903dbbae..15343660e47 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/kotlin/VirtualFileKotlinClassFinder.kt +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/kotlin/VirtualFileKotlinClassFinder.kt @@ -16,9 +16,6 @@ package org.jetbrains.jet.lang.resolve.kotlin -import com.intellij.ide.highlighter.JavaClassFileType -import com.intellij.openapi.vfs.VirtualFile -import org.jetbrains.annotations.Nullable import org.jetbrains.jet.lang.resolve.java.structure.JavaClass import org.jetbrains.jet.lang.resolve.java.structure.impl.JavaClassImpl import org.jetbrains.jet.lang.resolve.name.FqName @@ -38,10 +35,6 @@ public abstract class VirtualFileKotlinClassFinder() : VirtualFileFinder { file = file.getParent()!!.findChild(classFileName(javaClass) + ".class").sure("Virtual file not found for $javaClass") } - if (file.getFileType() != JavaClassFileType.INSTANCE) { - return null - } - return KotlinBinaryClassCache.getKotlinBinaryClass(file) }