From e7031cd44511e9debbb942c3a616eba08ac36316 Mon Sep 17 00:00:00 2001 From: wrongwrong Date: Fri, 11 Aug 2023 22:41:42 +0900 Subject: [PATCH 1/2] Replaced by simple comparison Because unsigned integers are a final class and there is no need to compare them with isAssignableFrom --- .../fasterxml/jackson/module/kotlin/KotlinSerializers.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinSerializers.kt b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinSerializers.kt index 05e0dd2e0..6821796af 100644 --- a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinSerializers.kt +++ b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinSerializers.kt @@ -102,10 +102,10 @@ internal class KotlinSerializers : Serializers.Base() { val rawClass = type.rawClass return when { - UByte::class.java.isAssignableFrom(rawClass) -> UByteSerializer - UShort::class.java.isAssignableFrom(rawClass) -> UShortSerializer - UInt::class.java.isAssignableFrom(rawClass) -> UIntSerializer - ULong::class.java.isAssignableFrom(rawClass) -> ULongSerializer + UByte::class.java == rawClass -> UByteSerializer + UShort::class.java == rawClass -> UShortSerializer + UInt::class.java == rawClass -> UIntSerializer + ULong::class.java == rawClass -> ULongSerializer // The priority of Unboxing needs to be lowered so as not to break the serialization of Unsigned Integers. rawClass.isUnboxableValueClass() -> ValueClassSerializer.from(rawClass) else -> null From 374cf40dac05f524d177bd643bb01d276a3e8079 Mon Sep 17 00:00:00 2001 From: wrongwrong Date: Fri, 11 Aug 2023 22:49:16 +0900 Subject: [PATCH 2/2] Update release notes wrt #700 --- release-notes/CREDITS-2.x | 1 + release-notes/VERSION-2.x | 1 + 2 files changed, 2 insertions(+) diff --git a/release-notes/CREDITS-2.x b/release-notes/CREDITS-2.x index d73de6fce..cb7f3b7bd 100644 --- a/release-notes/CREDITS-2.x +++ b/release-notes/CREDITS-2.x @@ -21,6 +21,7 @@ kkurczewski * #689: Add KotlinDuration support WrongWrong (@k163377) +* #700: Reduce the load on the search process for serializers * #687: Optimize and Refactor KotlinValueInstantiator.createFromObjectWith * #686: Add KotlinPropertyNameAsImplicitName option * #685: Streamline default value management for KotlinFeatures diff --git a/release-notes/VERSION-2.x b/release-notes/VERSION-2.x index 3ea730507..7d39d3d76 100644 --- a/release-notes/VERSION-2.x +++ b/release-notes/VERSION-2.x @@ -18,6 +18,7 @@ Co-maintainers: 2.16.0 (not yet released) +#700: Reduce the load on the search process for serializers. #689: Added UseJavaDurationConversion feature. By enabling this feature and adding the Java Time module, Kotlin Duration can be handled in the same way as Java Duration. #687: Optimize and Refactor KotlinValueInstantiator.createFromObjectWith.