dfa: fix & treatment

This commit is contained in:
peter
2013-09-12 22:15:05 +04:00
parent 1af2b843bd
commit 6af48bbd0a
3 changed files with 17 additions and 7 deletions
@@ -1163,7 +1163,7 @@ class ControlFlowAnalyzer extends JavaElementVisitor {
if (!shortCircuit) {
if (i > 0) {
combineStackBooleans(false, operand);
combineStackBooleans(true, operand);
}
continue;
}
@@ -36,9 +36,4 @@
<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>
</problem>
<problem>
<file>Test.java</file>
<line>52</line>
<description>Condition &lt;code&gt;o&lt;/code&gt; is always &lt;code&gt;true&lt;/code&gt;</description>
</problem>
</problems>
@@ -1,3 +1,5 @@
import org.jetbrains.annotations.NotNull;
class X {
int foo(String d1, String d2) {
@@ -7,7 +9,7 @@ class X {
}
void foo2(String d1, String d2) {
if(<warning descr="Condition 'd1 == null & d1 != null' is always 'true'">d1 == null & d1 != null</warning>)
if(<warning descr="Condition 'd1 == null & d1 != null' is always 'false'">d1 == null & d1 != null</warning>)
System.out.println("impossible");
}
@@ -17,3 +19,16 @@ class X {
}
}
class Doo {
void zoo(@NotNull Object t, @NotNull Object s) {
}
private void goo(Object t, Object t2) {
if (t != null & t2 != null) {
zoo(t, t2);
}
}
}