From 200944f8152313bf2b7bf9515e9e376250fbb14c Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Fri, 1 Nov 2024 10:44:10 +0200 Subject: [PATCH] Polish MongoClients --- .../main/java/io/quarkus/mongodb/runtime/MongoClients.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/runtime/MongoClients.java b/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/runtime/MongoClients.java index 125f978669dfb..e538026fe1f3a 100644 --- a/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/runtime/MongoClients.java +++ b/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/runtime/MongoClients.java @@ -158,12 +158,12 @@ public ClusterSettingBuilder(MongoClientConfig config) { @Override public void apply(ClusterSettings.Builder builder) { Optional maybeConnectionString = config.connectionString; - if (!maybeConnectionString.isPresent()) { + if (maybeConnectionString.isEmpty()) { // Parse hosts List hosts = parseHosts(config.hosts); builder.hosts(hosts); - if (hosts.size() == 1 && !config.replicaSetName.isPresent()) { + if (hosts.size() == 1 && config.replicaSetName.isEmpty()) { builder.mode(ClusterConnectionMode.SINGLE); } else { builder.mode(ClusterConnectionMode.MULTIPLE);