void (@NotNull PsiIfStatement statement) { super.visitIfStatement(statement); final PsiExpression condition = PsiUtil.skipParenthesizedExprDown(statement.getCondition()); if (!(condition instanceof PsiBinaryExpression binaryExpression)) { return; } final PsiReferenceExpression referenceExpression = extractVariableReference(binaryExpression); if (referenceExpression == null) { return; } final IElementType tokenType = binaryExpression.getOperationTokenType(); if (tokenType == JavaTokenType.EQEQ) { if (checkVariableUsage(referenceExpression, statement.getThenBranch(), statement.getElseBranch())) { registerError(referenceExpression, Boolean.TRUE); } } else if (tokenType == JavaTokenType.NE) { if (checkVariableUsage(referenceExpression, statement.getElseBranch(), statement.getThenBranch())) { registerError(referenceExpression, Boolean.TRUE); } } }