[JAVA-3157] Coverity analysis defect 105261: Explicit null dereferenced Created: 29/Jan/19  Updated: 28/Oct/23  Resolved: 30/Jan/19

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

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

Issue Links:
Duplicate
duplicates JAVA-3332 NullPointerException when using a upd... Closed

 Description   

Dereference of an explicit null value

Defect 105261 (STATIC_JAVA)
Checker FORWARD_NULL (subcategory deref_constant_zero)
File: /driver-core/src/main/com/mongodb/DBObjectCodec.java
Function com.mongodb.DBObjectCodec.beforeFields(org.bson.BsonWriter, org.bson.codecs.EncoderContext, com.mongodb.DBObject)



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

Author:

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

Message: Fix Coverity warning: Explicit null dereferenced

Ensure that DBObjectCodec invokes nested Codecs with the correct
EncoderContext.

Also address a few other warnings from IntelliJ in the same file.

JAVA-3157
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/2f87a4b0dda357dd2b82eed1a4bc7e001d2008f9

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