@@ -19,7 +19,7 @@ import kotlin.reflect.jvm.kotlinFunction
19
19
internal class ReflectionCache (reflectionCacheSize : Int ) : Serializable {
20
20
companion object {
21
21
// Increment is required when properties that use LRUMap are changed.
22
- private const val serialVersionUID = 1L
22
+ private const val serialVersionUID = 2L
23
23
}
24
24
25
25
sealed class BooleanTriState (val value : Boolean? ) {
@@ -42,8 +42,7 @@ internal class ReflectionCache(reflectionCacheSize: Int) : Serializable {
42
42
}
43
43
}
44
44
45
- private val javaConstructorToKotlin = LRUMap <Constructor <Any >, KFunction <Any >>(reflectionCacheSize, reflectionCacheSize)
46
- private val javaMethodToKotlin = LRUMap <Method , KFunction <* >>(reflectionCacheSize, reflectionCacheSize)
45
+ private val javaExecutableToKotlin = LRUMap <Executable , KFunction <* >>(reflectionCacheSize, reflectionCacheSize)
47
46
private val javaExecutableToValueCreator = LRUMap <Executable , ValueCreator <* >>(reflectionCacheSize, reflectionCacheSize)
48
47
private val javaConstructorIsCreatorAnnotated = LRUMap <AnnotatedConstructor , Boolean >(reflectionCacheSize, reflectionCacheSize)
49
48
private val javaMemberIsRequired = LRUMap <AnnotatedMember , BooleanTriState ?>(reflectionCacheSize, reflectionCacheSize)
@@ -57,11 +56,11 @@ internal class ReflectionCache(reflectionCacheSize: Int) : Serializable {
57
56
private val valueClassBoxConverterCache: LRUMap <KClass <* >, ValueClassBoxConverter <* , * >> =
58
57
LRUMap (0 , reflectionCacheSize)
59
58
60
- fun kotlinFromJava (key : Constructor <Any >): KFunction <Any >? = javaConstructorToKotlin .get(key)
61
- ? : key.kotlinFunction?.let { javaConstructorToKotlin .putIfAbsent(key, it) ? : it }
59
+ fun kotlinFromJava (key : Constructor <* >): KFunction <* >? = javaExecutableToKotlin .get(key)
60
+ ? : key.kotlinFunction?.let { javaExecutableToKotlin .putIfAbsent(key, it) ? : it }
62
61
63
- fun kotlinFromJava (key : Method ): KFunction <* >? = javaMethodToKotlin .get(key)
64
- ? : key.kotlinFunction?.let { javaMethodToKotlin .putIfAbsent(key, it) ? : it }
62
+ fun kotlinFromJava (key : Method ): KFunction <* >? = javaExecutableToKotlin .get(key)
63
+ ? : key.kotlinFunction?.let { javaExecutableToKotlin .putIfAbsent(key, it) ? : it }
65
64
66
65
/* *
67
66
* return null if...
0 commit comments