From fd10302fd653a771ebc7d659b0c9f622d7f916cf Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Tue, 14 Mar 2023 17:58:36 -0700 Subject: [PATCH] Manually merge #629 to master --- .../kotlin/tools/jackson/module/kotlin/ValueCreator.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/tools/jackson/module/kotlin/ValueCreator.kt b/src/main/kotlin/tools/jackson/module/kotlin/ValueCreator.kt index 1e64ee8f..da6bba31 100644 --- a/src/main/kotlin/tools/jackson/module/kotlin/ValueCreator.kt +++ b/src/main/kotlin/tools/jackson/module/kotlin/ValueCreator.kt @@ -24,9 +24,12 @@ internal sealed class ValueCreator { /** * ValueParameters of the KFunction to be called. */ - val valueParameters: List by lazy { callable.valueParameters } + // If this result is cached, it will coexist with the SoftReference managed value in kotlin-reflect, + // and there is a risk of doubling the memory consumption, so it should not be cached. + // @see #584 + val valueParameters: List get() = callable.valueParameters - /** +/** * Checking process to see if access from context is possible. * @throws IllegalAccessException */