[JAVA-3682] PolygonCoordinates Constructor throws NPE Created: 04/Apr/20 Updated: 06/Apr/20 Resolved: 06/Apr/20 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | None |
| Affects Version/s: | 3.12.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Florian Stefan | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Java 11 |
||
| Issue Links: |
|
||||||||
| Description |
|
Description The constructor of com.mongodb.client.model.geojson.PolygonCoordinates throws a NullPointerException when it is invoked with a List created by the factory method java.util.List.of().
Example
Explanation The factory method java.util.List.of() creates an instance of AbstractImmutableList. And the constructor of PolygonCoordinates checks if, e.g., its argument exterior contains a null value by invoking exterior.contains(null). But the method call AbstractImmutableList.contains(null) throws a NullPointerException. Suggestion Replace list.contains(null) with:
|
| Comments |
| Comment by Florian Stefan [ 04/Apr/20 ] |
|
Ah, didn't see that. Thanks for the quick response! |
| Comment by Jeffrey Yemin [ 04/Apr/20 ] |
|
Thanks for the report. This duplicates |