Say I have a method like this:
private final AutoCloseable afterClassCloser = ...;
@AfterClass(alwaysRun = true)
public final void close()
throws Exception
{
try (afterClassCloser) {
cleanupAndStuff();
}
}
Then CheckedExceptionNotThrown will report that the Exception is not thrown, even though it can be thrown by afterClassCloser::close.
If I change it to:
try (AutoCloseable ignored = afterClassCloser) {
cleanupAndStuff();
}
then there is no error.
Say I have a method like this:
Then
CheckedExceptionNotThrownwill report that theExceptionis not thrown, even though it can be thrown byafterClassCloser::close.If I change it to:
then there is no error.