Commit 7b6bf35b authored by Tagir Valeev's avatar Tagir Valeev
Browse files

IdempotentLoopBodyInspection: empty condition in for loop is allowed

Review ID: IDEA-CR-25479
parent 553e4d05
Showing with 1 addition and 1 deletion
+1 -1
......@@ -33,7 +33,7 @@ public class IdempotentLoopBodyInspection extends AbstractBaseJavaLocalInspectio
@Override
public void visitForStatement(PsiForStatement loop) {
PsiExpression condition = loop.getCondition();
if (condition == null || SideEffectChecker.mayHaveSideEffects(condition)) return;
if (condition != null && SideEffectChecker.mayHaveSideEffects(condition)) return;
if (isIdempotent(loop.getBody(), loop.getUpdate())) {
holder.registerProblem(loop.getFirstChild(), InspectionsBundle.message("inspection.idempotent.loop.body"));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment