Skip to content

Commit dad40ec

Browse files
authored
Merge pull request #700 from k163377/remove-is-assignable
Reduce the load on the search process for serializers
2 parents 9730a1b + 374cf40 commit dad40ec

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

release-notes/CREDITS-2.x

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ kkurczewski
2121
* #689: Add KotlinDuration support
2222

2323
WrongWrong (@k163377)
24+
* #700: Reduce the load on the search process for serializers
2425
* #687: Optimize and Refactor KotlinValueInstantiator.createFromObjectWith
2526
* #686: Add KotlinPropertyNameAsImplicitName option
2627
* #685: Streamline default value management for KotlinFeatures

release-notes/VERSION-2.x

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Co-maintainers:
1818

1919
2.16.0 (not yet released)
2020

21+
#700: Reduce the load on the search process for serializers.
2122
#689: Added UseJavaDurationConversion feature.
2223
By enabling this feature and adding the Java Time module, Kotlin Duration can be handled in the same way as Java Duration.
2324
#687: Optimize and Refactor KotlinValueInstantiator.createFromObjectWith.

src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinSerializers.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ internal class KotlinSerializers : Serializers.Base() {
102102
val rawClass = type.rawClass
103103

104104
return when {
105-
UByte::class.java.isAssignableFrom(rawClass) -> UByteSerializer
106-
UShort::class.java.isAssignableFrom(rawClass) -> UShortSerializer
107-
UInt::class.java.isAssignableFrom(rawClass) -> UIntSerializer
108-
ULong::class.java.isAssignableFrom(rawClass) -> ULongSerializer
105+
UByte::class.java == rawClass -> UByteSerializer
106+
UShort::class.java == rawClass -> UShortSerializer
107+
UInt::class.java == rawClass -> UIntSerializer
108+
ULong::class.java == rawClass -> ULongSerializer
109109
// The priority of Unboxing needs to be lowered so as not to break the serialization of Unsigned Integers.
110110
rawClass.isUnboxableValueClass() -> ValueClassSerializer.from(rawClass)
111111
else -> null

0 commit comments

Comments
 (0)