Skip to content

Commit

Permalink
Remove deprecation warnings. (#1613) (#1614)
Browse files Browse the repository at this point in the history
  • Loading branch information
vbabanin authored Feb 4, 2025
1 parent 93f0c18 commit 2a1d555
Showing 1 changed file with 0 additions and 15 deletions.
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

0 comments on commit 2a1d555

Please sign in to comment.