IDEA-74518: Associations for variable negation haven't been cleared on flush.

This commit is contained in:
Maxim Shafirov
2011-11-25 21:11:25 +04:00
parent 2fb8ab2a61
commit 57a78b6fab
8 changed files with 63 additions and 7 deletions
@@ -1,3 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems />
<problems>
<problem>
<file>NoWarnings.java</file>
<line>9</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Constant conditions &amp; exceptions</problem_class>
<description>Condition &lt;code&gt;i == 1&lt;/code&gt; is always &lt;code&gt;true&lt;/code&gt; when reached</description>
</problem>
</problems>
@@ -5,12 +5,17 @@ public class NoWarnings {
int i = 1;
boolean b = true;
while (i < 200) {
if (b && i == 1) { // Warning here: i == 1 is always true, but it is not so.
while (true) {
if (b && i == 1) {
b = false;
} else {
i++;
}
else {
i = g();
}
}
}
public int g() {
return 1;
}
}