Skip to content

Commit f8c14fd

Browse files
committed
Context: do not let close() throw Exception
The dispose() method does not throw exceptions, and we do not need to throw one when auto-closing. This prevents the compilation error: Unhandled exception type Exception thrown by automatic close() invocation on context which occurs with code of the form: try (Context context = new Context()) { ... }
1 parent 582bafe commit f8c14fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/scijava/Context.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ public void dispose() {
433433
// -- AutoCloseable methods --
434434

435435
@Override
436-
public void close() throws Exception {
436+
public void close() {
437437
dispose();
438438
}
439439

0 commit comments

Comments
 (0)