[JAVA-2756] Fix nested collections handling of null values in the PojoCodec Created: 29/Jan/18  Updated: 28/Oct/23  Resolved: 30/Jan/18

Status: Closed
Project: Java Driver
Component/s: POJO
Affects Version/s: 3.5.0
Fix Version/s: 3.6.2

Type: Bug Priority: Major - P3
Reporter: Ross Lawley Assignee: Ross Lawley
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by JAVA-2760 Codec conversion for list of list Closed

 Description   

> Fix for NPE in POJO codec when a POJO has a nested collection property and one of the nested values is null

https://github.com/mongodb/mongo-java-driver/pull/446



 Comments   
Comment by Githook User [ 30/Jan/18 ]

Author:

{'email': 'ross.lawley@gmail.com', 'name': 'Ross Lawley', 'username': 'rozza'}

Message: Extra Pojo with nulls values in collections and maps fixes

JAVA-2756
Branch: 3.6.x
https://github.com/mongodb/mongo-java-driver/commit/f2dc7725c6ae7eb70a97543fb465366049832790

Comment by Githook User [ 30/Jan/18 ]

Author:

{'email': 'robertrua@gmail.com', 'name': 'Rob Rua', 'username': 'robrua'}

Message: Check for for null collection elements in POJO CollectionCodec before deferring to codec.encode.

This fixes an NPE when a POJO has a nested collection element and one of the nested collection values is null.
JAVA-2756
Branch: 3.6.x
https://github.com/mongodb/mongo-java-driver/commit/3813249bf3c5833aa060e8c99090d189950be33c

Comment by Githook User [ 30/Jan/18 ]

Author:

{'email': 'ross.lawley@gmail.com', 'name': 'Ross Lawley', 'username': 'rozza'}

Message: Tests: Extra PojoCodec tests for nulls in collections

JAVA-2756 JAVA-2760
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/90627726414d042fd02cbd24239b5cfadd4fcb16

Comment by Githook User [ 29/Jan/18 ]

Author:

{'email': 'ross.lawley@gmail.com', 'name': 'Ross Lawley', 'username': 'rozza'}

Message: Extra Pojo with nulls values in collections and maps fixes

JAVA-2756
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/e38c3f751536d700d419325f5508bea55dc57fbd

Comment by Githook User [ 29/Jan/18 ]

Author:

{'email': 'robertrua@gmail.com', 'name': 'Rob Rua', 'username': 'robrua'}

Message: Check for for null collection elements in POJO CollectionCodec before deferring to codec.encode.

This fixes an NPE when a POJO has a nested collection element and one of the nested collection values is null.
JAVA-2756
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/bb07462cc2c54f6887530586bbe54614b2ef086a

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