[JAVA-3196] Incorrect javadoc signature on MongoCollection.insertMany method Created: 11/Feb/19  Updated: 28/Oct/23  Resolved: 27/Feb/19

Status: Closed
Project: Java Driver
Component/s: Documentation
Affects Version/s: 3.9.1
Fix Version/s: 3.11.0

Type: Improvement Priority: Minor - P4
Reporter: Mark Baker-Munton Assignee: Jeffrey Yemin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The @throws in the javadoc snippets below look to be incorrect. So far as I can tell these methods only ever returns a MongoBulkWriteException or a MongoException (similar to the other insertMany methods).

MongoCollection lines 855-865

    /**
     * Inserts one or more documents.  A call to this method is equivalent to a call to the {@code bulkWrite} method
     *
     * <p>Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.</p>
     * @param documents the documents to insert
     * @param options   the options to apply to the operation
     * @throws com.mongodb.DuplicateKeyException if the write failed to a duplicate unique key
     * @throws com.mongodb.WriteConcernException if the write failed due being unable to fulfil the write concern
     * @throws com.mongodb.MongoException        if the write failed due some other failure
     */
    void insertMany(List<? extends TDocument> documents, InsertManyOptions options);

and

MongoCollection lines 881-894

    /**
     * Inserts one or more documents.  A call to this method is equivalent to a call to the {@code bulkWrite} method
     *
     * <p>Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.</p>
     * @param clientSession the client session with which to associate this operation
     * @param documents the documents to insert
     * @param options   the options to apply to the operation
     * @throws com.mongodb.DuplicateKeyException if the write failed to a duplicate unique key
     * @throws com.mongodb.WriteConcernException if the write failed due being unable to fulfil the write concern
     * @throws com.mongodb.MongoException        if the write failed due some other failure
     * @since 3.6
     * @mongodb.server.release 3.6
     */
    void insertMany(ClientSession clientSession, List<? extends TDocument> documents, InsertManyOptions options);



 Comments   
Comment by Githook User [ 27/Feb/19 ]

Author:

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

Message: Correct @throws declarations in MongoCollection#insertMany Javadoc

JAVA-3196
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/3b25779ed75a4264658b08b2bccb2d6bb445df5c

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