Skip to content
This repository was archived by the owner on Jul 16, 2024. It is now read-only.

Commit b2535e5

Browse files
committed
Marked org.mongodb.scala.bson.DEFAULT_CODEC_REGISTRY as deprecated
SCALA-562
1 parent 1d00e12 commit b2535e5

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

bson/src/main/scala/org/mongodb/scala/bson/codecs/package.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import org.bson.codecs.configuration.CodecRegistry
2121
import com.mongodb.async.client.MongoClients
2222

2323
package object codecs {
24+
25+
@deprecated("Please use org.mongodb.scala.MongoClient.DEFAULT_CODEC_REGISTRY instead", "2.9.0")
2426
val DEFAULT_CODEC_REGISTRY: CodecRegistry = fromRegistries(
2527
fromProviders(DocumentCodecProvider(), IterableCodecProvider()),
2628
MongoClients.getDefaultCodecRegistry

docs/reference/content/changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ title = "Changelog"
1111
Changes between released versions
1212

1313
### 2.9.0
14-
* Revert Handle NPE caused by SingleResultCallback based Observables [SCALA-568](https://jira.mongodb.org/browse/SCALA-568F)
14+
* Marked `org.mongodb.scala.bson.DEFAULT_CODEC_REGISTRY` as deprecated [SCALA-562](https://jira.mongodb.org/browse/SCALA-562)
15+
* Revert Handle NPE caused by SingleResultCallback based Observables [SCALA-568](https://jira.mongodb.org/browse/SCALA-568)
1516

1617
### 2.8.0
1718
* Updated MongoDB Driver Async to 3.12.0

driver/src/main/scala/org/mongodb/scala/MongoClient.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ import java.io.Closeable
2121
import com.mongodb.ConnectionString
2222
import com.mongodb.async.SingleResultCallback
2323
import com.mongodb.async.client.{MongoClients, MongoClient => JMongoClient, MongoClientSettings => LegacyMongoClientSettings}
24+
import org.bson.codecs.configuration.CodecRegistries.{fromProviders, fromRegistries}
2425
import org.bson.codecs.configuration.CodecRegistry
2526
import org.mongodb.scala.bson.DefaultHelper.DefaultsTo
27+
import org.mongodb.scala.bson.codecs.{DocumentCodecProvider, IterableCodecProvider}
2628
import org.mongodb.scala.bson.conversions.Bson
2729
import org.mongodb.scala.internal.ObservableHelper.observe
2830

@@ -120,7 +122,10 @@ object MongoClient {
120122
MongoClient(MongoClients.create(clientSettings, builder.build()))
121123
}
122124

123-
val DEFAULT_CODEC_REGISTRY: CodecRegistry = org.mongodb.scala.bson.codecs.DEFAULT_CODEC_REGISTRY
125+
val DEFAULT_CODEC_REGISTRY: CodecRegistry = fromRegistries(
126+
fromProviders(DocumentCodecProvider(), IterableCodecProvider()),
127+
MongoClients.getDefaultCodecRegistry
128+
)
124129
}
125130

126131
/**

0 commit comments

Comments
 (0)