@@ -71,8 +71,9 @@ public class MongoClient extends Mongo {
7171 /**
7272 * Creates an instance based on a (single) mongodb node (localhost, default port).
7373 *
74- * @throws UnknownHostException
75- * @throws MongoException
74+ * @throws UnknownHostException This exception is no longer thrown, but leaving in throws clause so as not to break source
75+ * compatibility. The exception will be removed from the declaration in the next major release of the
76+ * driver.
7677 */
7778 public MongoClient () throws UnknownHostException {
7879 this (new ServerAddress ());
@@ -82,8 +83,9 @@ public MongoClient() throws UnknownHostException {
8283 * Creates a Mongo instance based on a (single) mongodb node.
8384 *
8485 * @param host server to connect to in format host[:port]
85- * @throws UnknownHostException if the database host cannot be resolved
86- * @throws MongoException
86+ * @throws UnknownHostException This exception is no longer thrown, but leaving in throws clause so as not to break source
87+ * compatibility. The exception will be removed from the declaration in the next major release of the
88+ * driver.
8789 */
8890 public MongoClient (String host ) throws UnknownHostException {
8991 this (new ServerAddress (host ));
@@ -94,8 +96,9 @@ public MongoClient(String host) throws UnknownHostException {
9496 *
9597 * @param host server to connect to in format host[:port]
9698 * @param options default query options
97- * @throws UnknownHostException if the database host cannot be resolved
98- * @throws MongoException
99+ * @throws UnknownHostException This exception is no longer thrown, but leaving in throws clause so as not to break source
100+ * compatibility. The exception will be removed from the declaration in the next major release of the
101+ * driver.
99102 */
100103 public MongoClient (String host , MongoClientOptions options ) throws UnknownHostException {
101104 this (new ServerAddress (host ), options );
@@ -106,8 +109,9 @@ public MongoClient(String host, MongoClientOptions options) throws UnknownHostEx
106109 *
107110 * @param host the database's host address
108111 * @param port the port on which the database is running
109- * @throws UnknownHostException if the database host cannot be resolved
110- * @throws MongoException
112+ * @throws UnknownHostException This exception is no longer thrown, but leaving in throws clause so as not to break source
113+ * compatibility. The exception will be removed from the declaration in the next major release of the
114+ * driver.
111115 */
112116 public MongoClient (String host , int port ) throws UnknownHostException {
113117 this (new ServerAddress (host , port ));
@@ -117,7 +121,6 @@ public MongoClient(String host, int port) throws UnknownHostException {
117121 * Creates a Mongo instance based on a (single) mongodb node
118122 *
119123 * @param addr the database address
120- * @throws MongoException
121124 * @see com.mongodb.ServerAddress
122125 */
123126 public MongoClient (ServerAddress addr ) {
@@ -129,7 +132,6 @@ public MongoClient(ServerAddress addr) {
129132 *
130133 * @param addr the database address
131134 * @param credentialsList the list of credentials used to authenticate all connections
132- * @throws MongoException
133135 * @see com.mongodb.ServerAddress
134136 * @since 2.11.0
135137 */
@@ -142,7 +144,6 @@ public MongoClient(ServerAddress addr, List<MongoCredential> credentialsList) {
142144 *
143145 * @param addr the database address
144146 * @param options default options
145- * @throws MongoException
146147 * @see com.mongodb.ServerAddress
147148 */
148149 public MongoClient (ServerAddress addr , MongoClientOptions options ) {
@@ -155,7 +156,6 @@ public MongoClient(ServerAddress addr, MongoClientOptions options) {
155156 * @param addr the database address
156157 * @param credentialsList the list of credentials used to authenticate all connections
157158 * @param options default options
158- * @throws MongoException
159159 * @see com.mongodb.ServerAddress
160160 * @since 2.11.0
161161 */
@@ -175,7 +175,6 @@ public MongoClient(ServerAddress addr, List<MongoCredential> credentialsList, Mo
175175 *
176176 * @param seeds Put as many servers as you can in the list and the system will figure out the rest. This can either be a list of mongod
177177 * servers in the same replica set or a list of mongos servers in the same sharded cluster.
178- * @throws MongoException
179178 * @see com.mongodb.ServerAddress
180179 */
181180 public MongoClient (List <ServerAddress > seeds ) {
@@ -193,7 +192,6 @@ public MongoClient(List<ServerAddress> seeds) {
193192 * @param seeds Put as many servers as you can in the list and the system will figure out the rest. This can either be a list
194193 * of mongod servers in the same replica set or a list of mongos servers in the same sharded cluster. \
195194 * @param credentialsList the list of credentials used to authenticate all connections
196- * @throws MongoException
197195 * @see com.mongodb.ServerAddress
198196 * @since 2.11.0
199197 */
@@ -212,7 +210,6 @@ public MongoClient(List<ServerAddress> seeds, List<MongoCredential> credentialsL
212210 * @param seeds Put as many servers as you can in the list and the system will figure out the rest. This can either be a list of
213211 * mongod servers in the same replica set or a list of mongos servers in the same sharded cluster.
214212 * @param options default options
215- * @throws MongoException
216213 * @see com.mongodb.ServerAddress
217214 */
218215 public MongoClient (List <ServerAddress > seeds , MongoClientOptions options ) {
@@ -231,7 +228,6 @@ public MongoClient(List<ServerAddress> seeds, MongoClientOptions options) {
231228 * of mongod servers in the same replica set or a list of mongos servers in the same sharded cluster.
232229 * @param credentialsList the list of credentials used to authenticate all connections
233230 * @param options default options
234- * @throws MongoException
235231 * @see com.mongodb.ServerAddress
236232 * @since 2.11.0
237233 */
@@ -246,8 +242,9 @@ public MongoClient(List<ServerAddress> seeds, List<MongoCredential> credentialsL
246242 * nodes.
247243 *
248244 * @param uri the URI
249- * @throws MongoException
250- * @throws UnknownHostException
245+ * @throws UnknownHostException This exception is no longer thrown, but leaving in throws clause so as not to break source
246+ * compatibility. The exception will be removed from the declaration in the next major release of the
247+ * driver.
251248 * @see MongoURI
252249 * @dochub connections
253250 */
0 commit comments