-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Enhance KotlinSerializer with value codecs for widening primitive conversion. #1301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
80a36cb
4c6c2ca
de50db6
dc12357
8818c6e
1f9933c
c80b17c
f984a8a
8e4bee5
bfe713a
636daa1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -217,6 +217,12 @@ | |
<Method name="~.*validateAnnotations.*"/> | ||
<Bug pattern="UC_USELESS_OBJECT"/> | ||
</Match> | ||
<Match> | ||
<!-- MongoDB status: "False Positive", SpotBugs rank: 17 --> | ||
<Class name="org.bson.codecs.kotlinx.KotlinSerializerCodec$Companion"/> | ||
<Method name="~.*validateAnnotations.*"/> | ||
<Bug pattern="BC_BAD_CAST_TO_ABSTRACT_COLLECTION"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The warning is triggered by an implicit cast generated during Kotlin to Java bytecode compilation, which is not directly controllable in the source Kotlin code. As this casting is safely handled by the Kotlin compiler and does not reflect an actual error in our Kotlin source, we can suppress this warning. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This still needed? |
||
</Match> | ||
|
||
<!-- Spotbugs reports false positives for suspendable operations with default params | ||
see: https://github.com/Kotlin/kotlinx.coroutines/issues/3099 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we discussed not using codecs (so to not confuse the two concepts of codecs and kserializers. Instead use the
NumberCodecHelper
directly (which is what the numeric codecs are doing in decode anyway).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the reminder. We did discuss prioritizing clarity by not mixing codecs with serializers. I've now implemented the changes to use the codec helpers directly as we discussed.