mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
22 lines
590 B
HTML
22 lines
590 B
HTML
<html>
|
|
<body>
|
|
Reports <code>while</code> loops that iterate
|
|
over collections and can be replaced with enhanced <code>for</code> loops (foreach iteration syntax).
|
|
<!-- 'foreach' still used in this description so that the inspection continues to be found using this keyword -->
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
Iterator it = c.iterator();
|
|
while(it.hasNext()) {
|
|
Object obj = it.next();
|
|
System.out.println(obj);
|
|
}
|
|
</code></pre>
|
|
<p>Can be replaced with:</p>
|
|
<pre><code>
|
|
for (Object obj : c) {
|
|
System.out.println(obj);
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
</body>
|
|
</html> |