Files
openide/java/java-impl/resources/inspectionDescriptions/ThrowFromFinallyBlock.html
Leonid Shalupov 40795fe787 IJI-2422: community/java: move resources under resources root
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
2025-02-05 04:43:28 +00:00

24 lines
717 B
HTML

<html>
<body>
Reports <code>throw</code> statements inside <code>finally</code> blocks.
While occasionally intended, such <code>throw</code> statements can hide exceptions thrown from the <code>try</code> and
<code>catch</code> blocks, thereby complicating the debugging process.
<p><b>Example:</b></p>
<pre><code>
class Fascinating {
void doTask(Task t) {
try {
t.activity();
} finally {
if (!t.finish()) {
throw new IllegalStateException();
}
}
}
}
</code></pre>
<!-- tooltip end -->
<p>Use the <b>Warn everywhere declared exceptions may be thrown</b> option
to warn on method calls to methods that declare exceptions as well.</p>
</body>
</html>