File tree Expand file tree Collapse file tree
driver-sync/src/test/functional/com/mongodb/client Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,12 +61,10 @@ public void close() {
6161 }
6262
6363 private static void disableAndClose (final BsonDocument failPointDocument , final MongoClient client ) {
64- try {
64+ try ( MongoClient ignored = client ) {
6565 client .getDatabase ("admin" ).runCommand (new BsonDocument ()
6666 .append ("configureFailPoint" , failPointDocument .getString ("configureFailPoint" ))
6767 .append ("mode" , new BsonString ("off" )));
68- } finally {
69- client .close ();
7068 }
7169 }
7270
@@ -88,8 +86,9 @@ private static final class Guard implements AutoCloseable {
8886 */
8987 FailPoint intoFailPoint () {
9088 assertFalse (consumed );
89+ FailPoint result = new FailPoint (failPointDocument , client );
9190 consumed = true ;
92- return new FailPoint ( failPointDocument , client ) ;
91+ return result ;
9392 }
9493
9594 /**
You can’t perform that action at this time.
0 commit comments