void (@NotNull PsiSwitchStatement statement) { super.visitSwitchStatement(statement); final int count = SwitchUtils.calculateBranchCount(statement); if (count < 0) return; PsiCodeBlock body = statement.getBody(); if (body == null || body.getRBrace() == null) return; boolean infoMode = false; if (count == 0) { if (!isOnTheFly) return; infoMode = true; } else { CompletenessResult completenessResult = PatternsInSwitchBlockHighlightingModel.evaluateSwitchCompleteness(statement); if (completenessResult == CompletenessResult.UNEVALUATED || completenessResult == CompletenessResult.COMPLETE_WITH_UNCONDITIONAL) return; if (m_ignoreFullyCoveredEnums && completenessResult == CompletenessResult.COMPLETE_WITHOUT_UNCONDITIONAL) { if (!isOnTheFly) return; infoMode = true; } } String message = InspectionGadgetsBundle.message("switch.statements.without.default.problem.descriptor"); if (infoMode || (isOnTheFly && InspectionProjectProfileManager.isInformationLevel(getShortName(), statement))) { holder.problem(statement, message).highlight(ProblemHighlightType.INFORMATION) .fix(new CreateDefaultBranchFix(statement, null)).register(); } else { holder.problem(statement.getFirstChild(), message).fix(new CreateDefaultBranchFix(statement, null)).register(); } }