From f4ded543dd2103a6fe4d40f5d9c5582b67fb8196 Mon Sep 17 00:00:00 2001 From: wrongwrong Date: Sun, 14 Jul 2024 12:30:49 +0900 Subject: [PATCH] Delete caches that are no longer needed --- .../com/fasterxml/jackson/module/kotlin/ReflectionCache.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/ReflectionCache.kt b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/ReflectionCache.kt index bdc80096..c313a638 100644 --- a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/ReflectionCache.kt +++ b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/ReflectionCache.kt @@ -22,7 +22,7 @@ import kotlin.reflect.jvm.kotlinFunction internal class ReflectionCache(reflectionCacheSize: Int) : Serializable { companion object { // Increment is required when properties that use LRUMap are changed. - private const val serialVersionUID = 2L + private const val serialVersionUID = 3L } sealed class BooleanTriState(val value: Boolean?) { @@ -47,7 +47,6 @@ internal class ReflectionCache(reflectionCacheSize: Int) : Serializable { private val javaExecutableToKotlin = LRUMap>(reflectionCacheSize, reflectionCacheSize) private val javaExecutableToValueCreator = LRUMap>(reflectionCacheSize, reflectionCacheSize) - private val javaConstructorIsCreatorAnnotated = LRUMap(reflectionCacheSize, reflectionCacheSize) private val javaMemberIsRequired = LRUMap(reflectionCacheSize, reflectionCacheSize) // Initial size is 0 because the value class is not always used @@ -103,9 +102,6 @@ internal class ReflectionCache(reflectionCacheSize: Int) : Serializable { ) } // we cannot reflect this method so do the default Java-ish behavior - fun checkConstructorIsCreatorAnnotated(key: AnnotatedConstructor, calc: (AnnotatedConstructor) -> Boolean): Boolean = javaConstructorIsCreatorAnnotated.get(key) - ?: calc(key).let { javaConstructorIsCreatorAnnotated.putIfAbsent(key, it) ?: it } - fun javaMemberIsRequired(key: AnnotatedMember, calc: (AnnotatedMember) -> Boolean?): Boolean? = javaMemberIsRequired.get(key)?.value ?: calc(key).let { javaMemberIsRequired.putIfAbsent(key, BooleanTriState.fromBoolean(it))?.value ?: it }