[JAVA-3719] MongoBulkWriteException.getWriteConcernError() is missing a @Nullable annotation Created: 04/May/20  Updated: 28/Oct/23  Resolved: 28/May/20

Status: Closed
Project: Java Driver
Component/s: API
Affects Version/s: None
Fix Version/s: 4.1.0

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


 Description   

I try to do a null check on the writeConcernError field in kotlin  as such:  
if (mongoBulkWriteException.writeConcernError !== null) throw ex My IDE (intellij) complains that this condition will always evaluate to true. The docs are clear that the field is nullable so my IDE is clearly wrong. I suspect adding the @Nullable annotation to the getter will help guide my IDE to stop misinforming me



 Comments   
Comment by Githook User [ 28/May/20 ]

Author:

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

Message: Added missing Nullable annotations

JAVA-3719
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/cc5f0f6b0a494f86fa40b0cd277c5f81c554e64c

Comment by Ross Lawley [ 27/May/20 ]

PR: https://github.com/rozza/mongo-java-driver/pull/386

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