Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecation warnings. (#1613) #1614

Merged
merged 1 commit into from
Feb 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions driver-core/src/main/com/mongodb/ConnectionString.java
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,6 @@ public ConnectionString(final String connectionString, @Nullable final DnsClient

credential = createCredentials(combinedOptionsMaps, userName, password);
warnOnUnsupportedOptions(combinedOptionsMaps);
warnDeprecatedTimeouts(combinedOptionsMaps);
}

private static final Set<String> GENERAL_OPTIONS_KEYS = new LinkedHashSet<>();
Expand All @@ -518,7 +517,6 @@ public ConnectionString(final String connectionString, @Nullable final DnsClient
private static final Set<String> WRITE_CONCERN_KEYS = new HashSet<>();
private static final Set<String> COMPRESSOR_KEYS = new HashSet<>();
private static final Set<String> ALL_KEYS = new HashSet<>();
private static final Set<String> DEPRECATED_TIMEOUT_KEYS = new HashSet<>();

static {
GENERAL_OPTIONS_KEYS.add("minpoolsize");
Expand Down Expand Up @@ -592,10 +590,6 @@ public ConnectionString(final String connectionString, @Nullable final DnsClient
ALL_KEYS.addAll(READ_PREFERENCE_KEYS);
ALL_KEYS.addAll(WRITE_CONCERN_KEYS);
ALL_KEYS.addAll(COMPRESSOR_KEYS);

DEPRECATED_TIMEOUT_KEYS.add("sockettimeoutms");
DEPRECATED_TIMEOUT_KEYS.add("waitqueuetimeoutms");
DEPRECATED_TIMEOUT_KEYS.add("wtimeoutms");
}

// Any options contained in the connection string completely replace the corresponding options specified in TXT records,
Expand All @@ -616,15 +610,6 @@ private void warnOnUnsupportedOptions(final Map<String, List<String>> optionsMap
.forEach(k -> LOGGER.warn(format("Connection string contains unsupported option '%s'.", k)));
}
}
private void warnDeprecatedTimeouts(final Map<String, List<String>> optionsMap) {
if (LOGGER.isWarnEnabled()) {
optionsMap.keySet()
.stream()
.filter(DEPRECATED_TIMEOUT_KEYS::contains)
.forEach(k -> LOGGER.warn(format("Use of deprecated timeout option: '%s'. Prefer 'timeoutMS' instead.", k)));
}
}


private void translateOptions(final Map<String, List<String>> optionsMap) {
boolean tlsInsecureSet = false;
Expand Down