From e359b9b6de60e5a706a65d06f0484036cebd252b Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Fri, 9 Dec 2016 19:25:34 +0300 Subject: [PATCH] Remove the code for idea 144 --- .../idea/caches/resolve/IdeaModuleInfos.kt | 31 +------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/IdeaModuleInfos.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/IdeaModuleInfos.kt index 50f185c3a6e..99b446f23d0 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/IdeaModuleInfos.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/IdeaModuleInfos.kt @@ -37,35 +37,6 @@ import org.jetbrains.kotlin.utils.emptyOrSingletonList import java.lang.reflect.Method import java.util.* -// TODO used reflection to be compatible with IDEA from both 143 and 144 branches, -// TODO switch to directly using when "since-build" will be >= 144.3357.4 -private val getRelatedProductionModule: (Module) -> Module? = run { - val klass = - try { - Class.forName("com.intellij.openapi.roots.TestModuleProperties") - } catch (e: ClassNotFoundException) { - return@run alwaysNull() - } - - - val getInstanceMethod: Method - val getProductionModuleMethod: Method - - try { - getInstanceMethod = klass.getDeclaredMethod("getInstance", Module::class.java) - getProductionModuleMethod = klass.getDeclaredMethod("getProductionModule") - } - catch (e: NoSuchMethodException) { - return@run alwaysNull() - } - - return@run { module -> - getInstanceMethod(null, module)?.let { - getProductionModuleMethod(it) as Module? - } - } -} - interface IdeaModuleInfo : ModuleInfo { fun contentScope(): GlobalSearchScope @@ -155,7 +126,7 @@ data class ModuleTestSourceInfo(override val module: Module) : ModuleSourceInfo override fun modulesWhoseInternalsAreVisible() = module.cached(CachedValueProvider { val list = SmartList(module.productionSourceInfo()) - getRelatedProductionModule(module)?.let { + TestModuleProperties.getInstance(module).productionModule?.let { list.add(it.productionSourceInfo()) }