[JAVA-4742] Support record components with more specific container class types Created: 28/Sep/22  Updated: 28/Oct/23  Resolved: 27/Oct/22

Status: Closed
Project: Java Driver
Component/s: POJO
Affects Version/s: None
Fix Version/s: 4.8.0

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

Issue Links:
Documented
Duplicate
is duplicated by JAVA-4620 RecordCodec fails to decode into a co... Closed
Backwards Compatibility: Fully Compatible
Documentation Changes: Needed

 Description   

The codec for records is not flexible when it comes to the declared types of the components for maps or collections. It works fine if the type is Iterable, Collection, List, or ArrayList for collections, and Map or HashMap for maps. But an exception will be thrown for other types, e.g. SortedSet, NavigableMap, LinkedList, TreeSet.

We should make MapCodec and IterableCodec more flexible, to handle all these cases.



 Comments   
Comment by Githook User [ 27/Oct/22 ]

Author:

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

Message: Support decoding to Collection and Map subclasses (#1019)

JAVA-4742
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/a999e15f23f20b77513a22139e91db2ac893606e

Generated at Thu Feb 08 09:02:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.