Files
openide/java/java-impl/resources/inspectionDescriptions/ForLoopReplaceableByWhile.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
751 B
HTML

<html>
<body>
Reports <code>for</code> loops that contain neither initialization nor update components, and suggests converting them to <code>while</code>
loops. This makes the code easier to read.
<p>Example:</p>
<pre><code>
for(; exitCondition(); ) {
process();
}
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
while(exitCondition()) {
process();
}
</code></pre>
<p>The quick-fix is also available for other <code>for</code> loops, so you can replace any <code>for</code> loop with a
<code>while</code> loop.</p>
<!-- tooltip end -->
<p>Use the <b>Ignore 'infinite' for loops without conditions</b> option if you want to ignore <code>for</code>
loops with trivial or non-existent conditions.
<p>
</body>
</html>