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

27 lines
715 B
HTML

<html>
<body>
<p>
Reports <code>while</code> loops that could be more effectively written as <code>do-while</code> loops.
There are <code>while</code> loops where the code just before the loop is identical to the code in the body of the loop.
Replacing with a <code>do-while</code> loop removes the duplicated code.
For <code>while</code> loops without such duplicated code, the quick fix is offered in the editor as well, but without highlighting.
</p>
<p><b>Example:</b></p>
<pre><code>
foo();
while (x) {
foo();
}
</code></pre>
<p>Can be replaced with:</p>
<pre><code>
do {
foo();
} while (x);
</code></pre>
<!-- tooltip end -->
<p>
<small>New in 2024.1</small>
</p>
</body>
</html>