Skip to content

Commit 2e5971d

Browse files
authored
ScopedObject should implement AutoCloseable (#150)
1 parent 8341684 commit 2e5971d

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/main/java/io/vertx/junit5/ScopedObject.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package io.vertx.junit5;
1818

19-
import org.junit.jupiter.api.extension.ExtensionContext;
20-
2119
import java.util.Objects;
2220
import java.util.function.Supplier;
2321

@@ -29,7 +27,7 @@
2927
* @param <T> Parameter type
3028
* @author <a href="https://julien.ponge.org/">Julien Ponge</a>
3129
*/
32-
public class ScopedObject<T> implements Supplier<T>, ExtensionContext.Store.CloseableResource {
30+
public class ScopedObject<T> implements Supplier<T>, AutoCloseable {
3331

3432
private T object;
3533
private final ParameterClosingConsumer<T> cleaner;
@@ -41,7 +39,7 @@ public class ScopedObject<T> implements Supplier<T>, ExtensionContext.Store.Clos
4139
}
4240

4341
@Override
44-
public void close() throws Throwable {
42+
public void close() throws Exception {
4543
cleaner.accept(object);
4644
}
4745

0 commit comments

Comments
 (0)