diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/AssignmentToForLoopParameter.html b/plugins/InspectionGadgets/src/inspectionDescriptions/AssignmentToForLoopParameter.html index 7e3650dd0987..163af3d227d9 100644 --- a/plugins/InspectionGadgets/src/inspectionDescriptions/AssignmentToForLoopParameter.html +++ b/plugins/InspectionGadgets/src/inspectionDescriptions/AssignmentToForLoopParameter.html @@ -2,7 +2,19 @@
Reports assignment to, or modification of for statement parameters inside the for loop body. While occasionally intended, this construct can be extremely confusing, and is often the result of a typo. -Assignments in plain for loops without an update statement are not reported. ++Assignments in basic for 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 for loop. +For example: +
+ for (int i = 0; i < list.size(); ) {
+ if (element.equals(list.get(i))) {
+ list.remove(i);
+ } else {
+ i++; // modification of for loop parameter
+ }
+ }
+