Skip to content

Commit 4b532c8

Browse files
committed
Update the DEFAULT_CODEC_REGISTRY order
Ensure that KotlinCodecProvider is used to handle any kotlin types first, then fall back to any native java codecs. For non kotlin users this will be a NOOP as the actual kotlin codec providers won't be on the class path JAVA-5928
1 parent 44e7add commit 4b532c8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

driver-core/src/main/com/mongodb/MongoClientSettings.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@
7070
@Immutable
7171
public final class MongoClientSettings {
7272
private static final CodecRegistry DEFAULT_CODEC_REGISTRY =
73-
fromProviders(asList(new ValueCodecProvider(),
73+
fromProviders(asList(
74+
new KotlinCodecProvider(),
75+
new ValueCodecProvider(),
7476
new BsonValueCodecProvider(),
7577
new DBRefCodecProvider(),
7678
new DBObjectCodecProvider(),
@@ -85,8 +87,7 @@ public final class MongoClientSettings {
8587
new BsonCodecProvider(),
8688
new EnumCodecProvider(),
8789
new ExpressionCodecProvider(),
88-
new Jep395RecordCodecProvider(),
89-
new KotlinCodecProvider()));
90+
new Jep395RecordCodecProvider()));
9091

9192
private final ReadPreference readPreference;
9293
private final WriteConcern writeConcern;

0 commit comments

Comments
 (0)