[JAVA-3635] GeoJSON Geometry constructors throw NPE Created: 27/Feb/20  Updated: 28/Oct/23  Resolved: 06/Apr/20

Status: Closed
Project: Java Driver
Component/s: Builders
Affects Version/s: None
Fix Version/s: 3.12.3, 4.0.2

Type: Bug Priority: Major - P3
Reporter: Oren Ovadia Assignee: Jeffrey Yemin
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-3682 PolygonCoordinates Constructor throws... Closed
Related

 Description   

When constructing geometries with immutable lists such as List.of(..), NPE's are thrown from !list.contains(null) checks performed by the constructors.

This does not happen in the codecs because ArrayList permits `null` arguments and elements.

Java's List API permits List implementations to either accept nulls or throw NPE.



 Comments   
Comment by Githook User [ 06/Apr/20 ]

Author:

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

Message: Use safe null-check for collection values

JAVA-3635
Branch: 3.12.x
https://github.com/mongodb/mongo-java-driver/commit/bdc80eb71154f81aa76fc71b20fe8098b86c55c9

Comment by Githook User [ 06/Apr/20 ]

Author:

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

Message: Use safe null-check for collection values

JAVA-3635
Branch: 4.0.x
https://github.com/mongodb/mongo-java-driver/commit/6f097e1d0ed078c29f9b4be91bd2e77c48fb0979

Comment by Githook User [ 06/Apr/20 ]

Author:

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

Message: Use safe null-check for collection values

JAVA-3635
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/075d45545ec45c215312d28907df3c4fed9e69dd

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