Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
7b6bf35b
Commit
7b6bf35b
authored
7 years ago
by
Tagir Valeev
Browse files
Options
Download
Email Patches
Plain Diff
IdempotentLoopBodyInspection: empty condition in for loop is allowed
Review ID: IDEA-CR-25479
parent
553e4d05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/java-impl/src/com/intellij/codeInspection/IdempotentLoopBodyInspection.java
+1
-1
...intellij/codeInspection/IdempotentLoopBodyInspection.java
with
1 addition
and
1 deletion
+1
-1
java/java-impl/src/com/intellij/codeInspection/IdempotentLoopBodyInspection.java
+
1
-
1
View file @
7b6bf35b
...
...
@@ -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"
));
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment