IDEA-122414 Boolean expression simplification changes behavior of the code

This commit is contained in:
peter
2014-03-28 19:30:28 +01:00
parent e24e934c7f
commit 6b91f55eb7
9 changed files with 60 additions and 23 deletions
@@ -33,7 +33,7 @@
<problem>
<file>Test.java</file>
<line>51</line>
<description>Condition &lt;code&gt;o&lt;/code&gt; at the left side of assignment expression is always &lt;code&gt;false&lt;/code&gt;. Can be simplified to normal assignment.</description>
<description>Condition &lt;code&gt;o&lt;/code&gt; at the left side of assignment expression is always &lt;code&gt;false&lt;/code&gt;. Can be simplified.</description>
</problem>
</problems>
@@ -0,0 +1,9 @@
class Contracts {
private boolean method(boolean a) {
boolean b = true;
<warning descr="Condition 'b' at the left side of assignment expression is always 'true'. Can be simplified"><caret>b</warning> |= a;
return b;
}
}
@@ -0,0 +1,8 @@
class Contracts {
private boolean method(boolean a) {
boolean b = true;
return b;
}
}