rmuir opened a new pull request #70:
URL: https://github.com/apache/lucene/pull/70
unusedExceptionParameter is a very useful check, as it detects if you catch
an exception and do nothing with it at all (swallowed).
As a library, its important to preserve exceptions (e.g. chain the root
cause, .addSuppressed, etc). This check helps prevent exceptions from getting
swallowed inadvertently.
If this is intentional for some reason, the exception can simply by
annotated with `@SuppressWarnings("unused")`.
In general, lucene is good about this today, and in most cases such
intentional swallowing is already being "annotated" adhoc with comments to
explain why it is ok to swallow the exception. This just requires it to be done
in a standardized way.
There were a lot of cases in tests, especially old tests. Still finding
various ad-hoc formulations of `expectThrows`, and I fixed some of the obvious
ones rather than just suppressing them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]