![JAR search and dependency download from the Maven repository](/logo.png)
resources.report.rules.findbugs.REC_CATCH_EXCEPTION.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sanity4j Show documentation
Show all versions of sanity4j Show documentation
Sanity4J was created to simplify running multiple static code
analysis tools on the Java projects. It provides a single entry
point to run all the selected tools and produce a consolidated
report, which presents all findings in an easily accessible
manner.
The newest version!
REC: Exception is caught when Exception is not thrown (REC_CATCH_EXCEPTION)
REC: Exception is caught when Exception is not thrown (REC_CATCH_EXCEPTION)
This method uses a try-catch block that catches Exception objects, but Exception is not
thrown within the try block, and RuntimeException is not explicitly caught. It is a common bug pattern to
say try { ... } catch (Exception e) { something } as a shorthand for catching a number of types of exception
each of whose catch blocks is identical, but this construct also accidentally catches RuntimeException as well,
masking potential bugs.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy