initialized twice should not make use of computed constants (IDEA-63226)

This commit is contained in:
Anna Kozlova
2014-10-30 18:41:04 +01:00
parent 14f91eb65f
commit 2a71679bc4
2 changed files with 13 additions and 2 deletions
@@ -531,7 +531,7 @@ public class HighlightControlFlowUtil {
Collection<ControlFlowUtil.VariableInfo> codeBlockProblems = finalVarProblems.get(codeBlock);
if (codeBlockProblems == null) {
try {
final ControlFlow controlFlow = getControlFlow(codeBlock);
final ControlFlow controlFlow = getControlFlowNoConstantEvaluate(codeBlock);
codeBlockProblems = ControlFlowUtil.getInitializedTwice(controlFlow);
}
catch (AnalysisCanceledException e) {
@@ -339,7 +339,7 @@ public class a {
final int k;
if (false) {
k = 0;
k = 1;
<error descr="Variable 'k' might already have been assigned to">k</error> = 1;
System.out.println(k);
}
}
@@ -415,4 +415,15 @@ class SwitchTest
return "";
}
}
}
class NotDefinitelyUnassigned {
final int i;
NotDefinitelyUnassigned() {
if (false) {
i = 0;
}
<error descr="Variable 'i' might already have been assigned to">i</error> = 1;
}
}