Skip to content

Commit 18c8d33

Browse files
tsegismontyeikel
andauthored
ScopedObject should implement AutoCloseable (#152)
* ScopedObject should implement AutoCloseable * To support older versions, ScopedObject must still implement ExtensionContext.Store Signed-off-by: Thomas Segismont <tsegismont@gmail.com> --------- Signed-off-by: Thomas Segismont <tsegismont@gmail.com> Co-authored-by: Yeikel Santana <email@yeikel.com>
1 parent cf069f2 commit 18c8d33

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* @param <T> Parameter type
3030
* @author <a href="https://julien.ponge.org/">Julien Ponge</a>
3131
*/
32-
public class ScopedObject<T> implements Supplier<T>, ExtensionContext.Store.CloseableResource {
32+
public class ScopedObject<T> implements Supplier<T>, ExtensionContext.Store.CloseableResource, AutoCloseable {
3333

3434
private T object;
3535
private final ParameterClosingConsumer<T> cleaner;
@@ -41,7 +41,7 @@ public class ScopedObject<T> implements Supplier<T>, ExtensionContext.Store.Clos
4141
}
4242

4343
@Override
44-
public void close() throws Throwable {
44+
public void close() throws Exception {
4545
cleaner.accept(object);
4646
}
4747

0 commit comments

Comments
 (0)