mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Java: Fixed false positive unused declarations under constant conditions (IDEA-182738)
This commit is contained in:
@@ -146,7 +146,7 @@ public class DefUseUtil {
|
||||
|
||||
ControlFlow flow;
|
||||
try {
|
||||
flow = ControlFlowFactory.getInstance(body.getProject()).getControlFlow(body, ourPolicy);
|
||||
flow = ControlFlowFactory.getInstance(body.getProject()).getControlFlow(body, ourPolicy, false);
|
||||
}
|
||||
catch (AnalysisCanceledException e) {
|
||||
return null;
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
class C {
|
||||
void foo(int n) {
|
||||
if (false) {
|
||||
int[] a = new int[n];
|
||||
a[0] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,6 +69,7 @@ public class DefUseTest extends LightCodeInsightFixtureTestCase {
|
||||
}
|
||||
public void testFieldInitializerUsedInMethodReference() { doTest(); }
|
||||
public void testFieldInitializerChainedConstructor() { doTest(); }
|
||||
public void testUnderAlwaysFalseCondition() { doTest(); }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user