Grade. Findbugs has several exception detectors for errors:
- DE: The method may throw an exception
- DE: Method may ignore exception
- Nm: A class is not derived from an exception, although it is named as such
- RV: Exception thrown and deleted, not thrown
- REC: An exception is thrown when an exception is not thrown.
as well as findbugs-contrib (the findbugs plugin) has several:
- BED_BOGUS_EXCEPTION_DECLARATION
- DRE_DECLARED_RUNTIME_EXCEPTION
- EXS_EXCEPTION_SOFTENING_NO_CHECKED
- EXS_EXCEPTION_SOFTENING_HAS_CHECKED
- EXS_EXCEPTION_SOFTENING_NO_CONSTRAINTS
Try checking and checking to see if they meet your requirements (especially the last (REC) from fb). However, if you explicitly need to discover the following pattern:
catch ( RuntimeException re){ .... }
You may need to implement your own (fairly simple) error pattern for findbugs ...
source share