Skip to content
Closed

2.x #1045

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@
com.fasterxml.jackson.module.kotlin.KotlinModule#getEnabledSingletonSupport()
</exclude>
<exclude>com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException</exclude>
<exclude>com.fasterxml.jackson.module.kotlin.ValueClassUnboxSerializer</exclude>
<!-- internal -->
<exclude>
com.fasterxml.jackson.module.kotlin.KotlinInstantiators#KotlinInstantiators(com.fasterxml.jackson.module.kotlin.ReflectionCache,boolean,boolean,boolean,boolean)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,6 @@ object ULongSerializer : StdSerializer<ULong>(ULong::class.java) {
}
}

internal object ValueClassUnboxSerializer : StdSerializer<Any>(Any::class.java) {
private fun readResolve(): Any = ValueClassUnboxSerializer

override fun serialize(value: Any, gen: JsonGenerator, provider: SerializerProvider) {
val unboxed = value::class.java.getMethod("unbox-impl").invoke(value)
provider.defaultSerializeValue(unboxed, gen)
}
}

// Class must be UnboxableValueClass.
private fun Class<*>.getStaticJsonValueGetter(): Method? = this.declaredMethods.find { method ->
Modifier.isStatic(method.modifiers) && method.annotations.any { it is JsonValue && it.value }
Expand Down
Loading