ControlFlowAnalyzer: pass the control from expression statements to multi-catch exceptions

Fixes IDEA-232103 "Field may be 'final'" false positive for fields initialized in try-catch block with multi-catch

GitOrigin-RevId: b286eb0ac347350490d3aaa35768fc4e0404db28
This commit is contained in:
Tagir Valeev
2020-02-05 07:01:46 +00:00
committed by intellij-monorepo-bot
parent 3f182bfa57
commit 3ab008193a
3 changed files with 40 additions and 2 deletions
@@ -85,4 +85,21 @@ class D {
System.out.println(e);
}
}
}
class AssignFinal {
private final String value;
public AssignFinal() {
try {
value = create();
} catch (ClassNotFoundException | IllegalAccessException e) {
<error descr="Variable 'value' might already have been assigned to">value</error> = "";
}
}
public String getValue() {
return value;
}
public static native <T> T create() throws ClassNotFoundException, IllegalAccessException;
}