File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
src/main/kotlin/io/github/projectmapk/jackson/module/kogera Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -57,18 +57,17 @@ internal class ReflectionCache(reflectionCacheSize: Int) : Serializable {
5757
5858 // Return boxed type on Kotlin for unboxed getters
5959 fun findBoxedReturnType (getter : AnnotatedMethod ): Class <* >? {
60- val method = getter.member.apply {
61- // If the return value of the getter is a value class,
62- // it will be serialized properly without doing anything.
63- // TODO: Verify the case where a value class encompasses another value class.
64- if (this .returnType.isUnboxableValueClass()) return null
65- }
66-
60+ val method = getter.member
6761 val optional = valueClassReturnTypeCache.get(method)
6862
6963 return if (optional != null ) {
7064 optional
7165 } else {
66+ // If the return value of the getter is a value class,
67+ // it will be serialized properly without doing anything.
68+ // TODO: Verify the case where a value class encompasses another value class.
69+ if (method.returnType.isUnboxableValueClass()) return null
70+
7271 val value = Optional .ofNullable(method.getValueClassReturnType())
7372 (valueClassReturnTypeCache.putIfAbsent(method, value) ? : value)
7473 }.orElse(null )
You can’t perform that action at this time.
0 commit comments