mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 22:09:38 +07:00
IfStatementWithIdenticalBranchesInspection: more correct variable substitution : IDEA-229916
GitOrigin-RevId: b8abb67866823a84dac2b3dc4070e088926e0527
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2bcc2a5a13
commit
fa9c908137
@@ -0,0 +1,18 @@
|
||||
// "Collapse 'if' statement" "false"
|
||||
|
||||
|
||||
public class Main {
|
||||
// https://youtrack.jetbrains.com/issue/IDEA-229916
|
||||
public void analysisBugWithMinAndMax(int width, int height, boolean someFlag) {
|
||||
if<caret> (someFlag) {
|
||||
int a = Math.max(width, height);
|
||||
int b = Math.min(width, height);
|
||||
System.out.println("a=" + a + ", b=" + b);
|
||||
}
|
||||
else {
|
||||
int b = Math.max(width, height);
|
||||
int a = Math.min(width, height);
|
||||
System.out.println("a=" + a + ", b=" + b);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user