[JAVA-4141] Fix exception message in ClusterSettings Created: 05/May/21  Updated: 28/Oct/23  Resolved: 14/Jun/21

Status: Closed
Project: Java Driver
Component/s: Configuration
Affects Version/s: None
Fix Version/s: 4.3.0

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

Backwards Compatibility: Fully Compatible
Documentation Changes: Not Needed

 Description   

In ClusterSettings constructor:

           if (builder.srvHost.split("\\.").length < 3) {
                throw new IllegalArgumentException(format("An SRV host name '%s' was provided that does not contain at least three parts. "
                        + "It must contain a hostname, domain name and a top level domain.", builder.hosts.get(0).getHost()));
            }

should be:

           if (builder.srvHost.split("\\.").length < 3) {
                throw new IllegalArgumentException(format("An SRV host name '%s' was provided that does not contain at least three parts. "
                        + "It must contain a hostname, domain name and a top level domain.", builder.srvHost));
            }

 



 Comments   
Comment by Githook User [ 14/Jun/21 ]

Author:

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

Message: Fix exception message in ClusterSettings

Previously, an exception message about srvHost incorrectly referred
to the hosts list. It's now update to refer to srvHost.

JAVA-4141
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/cc71501bb3c46ce161311d32038a1bb447861231

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