Implement Java 9 module visibility checks
In this commit, only IDE tests are added, because we look for module declarations in the IDE across the whole project, whereas in the compiler we should do this on the module path only and that requires separate work (KT-18599) which is done in the following commits. (The change in Cache.kt is needed so that JvmModuleAccessibilityChecker.ClassifierUsage, which is an inner class, would be injected properly.) #KT-18598 In Progress #KT-18599 In Progress
This commit is contained in:
@@ -18,8 +18,7 @@ package org.jetbrains.kotlin.container
|
||||
|
||||
import com.intellij.util.containers.ContainerUtil
|
||||
import java.lang.reflect.*
|
||||
import java.util.ArrayList
|
||||
import java.util.LinkedHashSet
|
||||
import java.util.*
|
||||
|
||||
private object ClassTraversalCache {
|
||||
private val cache = ContainerUtil.createConcurrentWeakKeySoftValueMap<Class<*>, ClassInfo>()
|
||||
@@ -82,7 +81,11 @@ private fun getConstructorInfo(c: Class<*>): ConstructorInfo? {
|
||||
return null
|
||||
|
||||
val constructor = constructors.single()
|
||||
return ConstructorInfo(constructor, constructor.genericParameterTypes.toList())
|
||||
val parameterTypes =
|
||||
if (c.declaringClass != null && !Modifier.isStatic(c.modifiers))
|
||||
listOf(c.declaringClass, *constructor.genericParameterTypes)
|
||||
else constructor.genericParameterTypes.toList()
|
||||
return ConstructorInfo(constructor, parameterTypes)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user