I've got some native code with two methods on it `...
# announcements
g
I've got some native code with two methods on it
run
and
cleanup
, which are being called from java.
cleanup
should be called in a finally context, but if
run
throws then its probabl that
cleanup
will throw as well, but
run
is going to throw with a substantially better stack trace. Whats the easiest way to adapt these two methods to the try-with-resources (aka
use
) style of execute the main block, call the finally block, suppress the finally blocks exception if the main block threw one