mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-28 17:09:38 +07:00
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
21 lines
691 B
HTML
21 lines
691 B
HTML
<html>
|
|
<body>
|
|
Reports <code>throw</code> statements whose exceptions are always
|
|
caught by containing <code>try</code> statements.
|
|
<p>Using <code>throw</code>
|
|
statements as a "goto" to change the local flow of control is confusing and results in poor performance.
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
try {
|
|
if (!Files.isDirectory(PROJECTS)) {
|
|
throw new IllegalStateException("Directory not found."); // warning: 'throw' caught by containing 'try' statement
|
|
}
|
|
...
|
|
} catch (Exception e) {
|
|
LOG.error("run failed");
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p>Use the <b>Ignore rethrown exceptions</b> option to ignore exceptions that are rethrown.</p>
|
|
</body>
|
|
</html> |