ci.jenkins.io / SpotBugs
failed
Feb 2, 2024 in 0s
1 new issue
Total | New | Outstanding | Fixed | Trend |
---|---|---|---|---|
1 | 1 | 0 | 0 | 👎 |
Reference build: Plugins » datadog-plugin » master #133
Details
Severity distribution of new issues
Error | Warning High | Warning Normal | Warning Low |
---|---|---|---|
0 | 0 | 1 | 0 |
Annotations
ci-jenkins-io / SpotBugs
REC_CATCH_EXCEPTION
NORMAL:
Exception is caught when Exception is not thrown in org.datadog.jenkins.plugins.datadog.listeners.DatadogBuildListener.onCompleted(Run, TaskListener)
Raw output
<p> 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. </p> <p>A better approach is to either explicitly catch the specific exceptions that are thrown, or to explicitly catch RuntimeException exception, rethrow it, and then catch all non-Runtime Exceptions, as shown below:</p> <pre><code>try { ... } catch (RuntimeException e) { throw e; } catch (Exception e) { ... deal with all non-runtime exceptions ... } </code></pre>
Loading