Skip to content

Commit bf091c8

Browse files
committed
Remove code duplication
1 parent 9527c56 commit bf091c8

File tree

1 file changed

+1
-13
lines changed
  • vertx-sql-client/src/main/java/io/vertx/sqlclient

1 file changed

+1
-13
lines changed

vertx-sql-client/src/main/java/io/vertx/sqlclient/Pool.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,7 @@ static Pool pool(SqlConnectOptions connectOptions) {
5454
* Like {@link #pool(Vertx, SqlConnectOptions, PoolOptions)} with a Vert.x instance created automatically.
5555
*/
5656
static Pool pool(SqlConnectOptions database, PoolOptions options) {
57-
List<Driver> candidates = new ArrayList<>(1);
58-
for (Driver d : ServiceLoader.load(Driver.class)) {
59-
if (d.acceptsOptions(database)) {
60-
candidates.add(d);
61-
}
62-
}
63-
if (candidates.size() == 0) {
64-
throw new ServiceConfigurationError("No implementations of " + Driver.class + " found that accept connection options " + database);
65-
} else if (candidates.size() > 1) {
66-
throw new ServiceConfigurationError("Multiple implementations of " + Driver.class + " found: " + candidates);
67-
} else {
68-
return candidates.get(0).createPool(null, Collections.singletonList(database), options);
69-
}
57+
return pool(null, database, options);
7058
}
7159

7260
/**

0 commit comments

Comments
 (0)