Java control flow: Collect more data on try-catch statements which contain errors ahd therefore can't be handled normally. Use LOG.error for that instead of 'assert'

This commit is contained in:
Pavel Dolgov
2016-08-15 20:18:43 +03:00
parent a94184b12f
commit 75ba67cd90
@@ -1121,8 +1121,12 @@ class ControlFlowAnalyzer extends JavaElementVisitor {
generateWriteInstruction(catchBlockParameters[i]);
}
PsiCodeBlock catchBlock = catchBlocks[i];
assert catchBlock != null : i + statement.getText();
catchBlock.accept(this);
if (catchBlock != null) {
catchBlock.accept(this);
}
else {
LOG.error("Catch body is null (" + i + ") " + statement.getText());
}
myCurrentFlow.addInstruction(new GoToInstruction(finallyBlock == null ? 0 : -6));
if (finallyBlock == null) {