Files
openide/java/java-impl/resources/inspectionDescriptions/InfiniteLoopStatement.html
2025-02-05 04:43:28 +00:00

26 lines
590 B
HTML

<html>
<body>
Reports <code>for</code>, <code>while</code>,
or <code>do</code> statements that
can only exit by throwing an exception. While such statements may be correct, they
often happen due to coding errors.
<p>Example:</p>
<pre><code>
for (;;) {
}
</code></pre>
<!-- tooltip end -->
<p>
Use the <b>Ignore when placed in Thread.run</b> option to ignore the
infinite loop statements inside <code>Thread.run</code>.
It may be useful for the daemon threads.
<p>Example:</p>
<pre><code>
new Thread(() -&gt; {
while (true) {
}
}).start();
</code></pre>
<p>
</body>
</html>