Skip to content
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

Kotlin. Support stored nulls for nullable fields #1212

Merged
merged 2 commits into from
Oct 4, 2023

Conversation

rozza
Copy link
Member

@rozza rozza commented Oct 3, 2023

@rozza rozza requested review from a team and stIncMale and removed request for a team October 3, 2023 10:51
@@ -85,6 +85,8 @@ internal data class DataClassCodec<T : Any>(
if (logger.isTraceEnabled) {
logger.trace("Found property not present in the DataClass: $fieldName")
}
} else if (propertyModel.param.type.isMarkedNullable && reader.currentBsonType == BsonType.NULL) {
reader.skipValue()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: reader.readNull() is a bit clearer in intent, and a bit more efficient as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack

reader.readNull()
@rozza rozza merged commit 6a20fb6 into mongodb:master Oct 4, 2023
1 check was pending
@rozza rozza deleted the JAVA-5134 branch October 4, 2023 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants