mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IG: clarify description
This commit is contained in:
+13
-1
@@ -2,7 +2,19 @@
|
||||
<body>
|
||||
Reports assignment to, or modification of <b>for</b> statement parameters inside the <b>for</b> loop body.
|
||||
While occasionally intended, this construct can be extremely confusing, and is often the result of a typo.
|
||||
Assignments in plain <b>for</b> loops without an update statement are not reported.
|
||||
<p>
|
||||
Assignments in basic <b>for</b> loops without an update statement are not reported.
|
||||
In these cases the assignment is probably intended and can't be easily moved to the update part of the <b>for</b> loop.
|
||||
For example:
|
||||
<pre><code>
|
||||
<b>for</b> (<b>int</b> i = 0; i < list.size(); ) {
|
||||
<b>if</b> (element.equals(list.get(i))) {
|
||||
list.remove(i);
|
||||
} <b>else</b> {
|
||||
i++; // modification of for loop parameter
|
||||
}
|
||||
}
|
||||
</code></pre>
|
||||
<!-- tooltip end -->
|
||||
<p>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user