We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
CheckedExceptionNotThrown
Exception
afterClassCloser::close
If I change it to:
try (AutoCloseable ignored = afterClassCloser) { cleanupAndStuff(); }
then there is no error.
The text was updated successfully, but these errors were encountered:
Thanks for the report, that's a nice one! I've never seen the assignment-free try-with-resources syntax. Looks like it's "new" in Java 9.
Sorry, something went wrong.
getThrownExceptions: handle try(var) {} form of try-with-resources too.
4a1a034
Fixes external #3321 PiperOrigin-RevId: 464039917
36e90e1
Fixes external #3321 PiperOrigin-RevId: 464496204
No branches or pull requests
Say I have a method like this:
Then
CheckedExceptionNotThrown
will report that theException
is not thrown, even though it can be thrown byafterClassCloser::close
.If I change it to:
then there is no error.
The text was updated successfully, but these errors were encountered: