Skip to content

Commit f4ded54

Browse files
committed
Delete caches that are no longer needed
1 parent 7d90528 commit f4ded54

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/main/kotlin/com/fasterxml/jackson/module/kotlin/ReflectionCache.kt

+1-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import kotlin.reflect.jvm.kotlinFunction
2222
internal class ReflectionCache(reflectionCacheSize: Int) : Serializable {
2323
companion object {
2424
// Increment is required when properties that use LRUMap are changed.
25-
private const val serialVersionUID = 2L
25+
private const val serialVersionUID = 3L
2626
}
2727

2828
sealed class BooleanTriState(val value: Boolean?) {
@@ -47,7 +47,6 @@ internal class ReflectionCache(reflectionCacheSize: Int) : Serializable {
4747

4848
private val javaExecutableToKotlin = LRUMap<Executable, KFunction<*>>(reflectionCacheSize, reflectionCacheSize)
4949
private val javaExecutableToValueCreator = LRUMap<Executable, ValueCreator<*>>(reflectionCacheSize, reflectionCacheSize)
50-
private val javaConstructorIsCreatorAnnotated = LRUMap<AnnotatedConstructor, Boolean>(reflectionCacheSize, reflectionCacheSize)
5150
private val javaMemberIsRequired = LRUMap<AnnotatedMember, BooleanTriState?>(reflectionCacheSize, reflectionCacheSize)
5251

5352
// Initial size is 0 because the value class is not always used
@@ -103,9 +102,6 @@ internal class ReflectionCache(reflectionCacheSize: Int) : Serializable {
103102
)
104103
} // we cannot reflect this method so do the default Java-ish behavior
105104

106-
fun checkConstructorIsCreatorAnnotated(key: AnnotatedConstructor, calc: (AnnotatedConstructor) -> Boolean): Boolean = javaConstructorIsCreatorAnnotated.get(key)
107-
?: calc(key).let { javaConstructorIsCreatorAnnotated.putIfAbsent(key, it) ?: it }
108-
109105
fun javaMemberIsRequired(key: AnnotatedMember, calc: (AnnotatedMember) -> Boolean?): Boolean? = javaMemberIsRequired.get(key)?.value
110106
?: calc(key).let { javaMemberIsRequired.putIfAbsent(key, BooleanTriState.fromBoolean(it))?.value ?: it }
111107

0 commit comments

Comments
 (0)