boolean (@NotNull PsiIfStatement ifStatement, PsiVariable variable, @NotNull Set<MethodSignature> checkedMethods, boolean strict) { final PsiExpression condition = ifStatement.getCondition(); if (expressionAssignsVariableOrFails(condition, variable, checkedMethods, strict)) { return true; } final PsiStatement thenBranch = ifStatement.getThenBranch(); if (BoolUtils.isTrue(condition)) { return statementAssignsVariableOrFails(thenBranch, variable, checkedMethods, strict); } final PsiStatement elseBranch = ifStatement.getElseBranch(); if (BoolUtils.isFalse(condition)) { return statementAssignsVariableOrFails(elseBranch, variable, checkedMethods, strict); } return statementAssignsVariableOrFails(thenBranch, variable, checkedMethods, strict) && statementAssignsVariableOrFails(elseBranch, variable, checkedMethods, strict); }