[JAVA-1675] CodecRegistryHelper.fromRegistries does not properly resolve Codecs Created: 05/Mar/15  Updated: 31/Mar/15  Resolved: 06/Mar/15

Status: Closed
Project: Java Driver
Component/s: Codecs
Affects Version/s: None
Fix Version/s: 3.0.0

Type: Bug Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

This:

	CodecRegistryHelper.fromRegistries(CodecRegistryHelper.fromCodec(new UuidCodec(UuidRepresentation.STANDARD)),
		                                                    MongoClient.getDefaultCodecRegistry()));

does not work as expected. The problem is that when the second registry creates, say, a DocumentCodec, it does so with no knowledge of the outer registry. When the Document Codec subsequently gets a UUIDCodec, it gets it from the second registry rather than the outer registry.



 Comments   
Comment by Jeffrey Yemin [ 31/Mar/15 ]

Closing all resolved 3.0.0 issues, as 3.0.0 has been tagged and released.

Comment by Githook User [ 06/Mar/15 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: Added comment to MongoClientOptions.Builder.codecRegistry to note that DB/DBCollection do not use the registry.

JAVA-1675
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/afc9a3b8271bafba1c4d46c6139f9c98d1c394df

Comment by Githook User [ 06/Mar/15 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: Renamed CodecRegistryHelper to CodecRegistries.
Flattened out registries so that nested registries are always treated as providers, so that Codec dependencies between registries are
properly resolved.
Changed CodecRegistries API so that it's more uniform. There are now two flavors each of fromCodecs, fromProviders, and fromRegistries,
one which takes varargs, and the other a List.

JAVA-1675
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/5c0f4caef43d85a03efa48b99eafa3dead9c668a

Generated at Thu Feb 08 08:55:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.