boolean (PsiIfStatement ifStatement, PsiExpression switchExpression) { final PsiType type = switchExpression.getType(); if (!suggestIntSwitches) { if (type instanceof PsiClassType) { if (type.equalsToText(CommonClassNames.JAVA_LANG_INTEGER) || type.equalsToText(CommonClassNames.JAVA_LANG_SHORT) || type.equalsToText(CommonClassNames.JAVA_LANG_BYTE) || type.equalsToText(CommonClassNames.JAVA_LANG_CHARACTER)) { return false; } } else if (PsiTypes.intType().equals(type) || PsiTypes.shortType().equals(type) || PsiTypes.byteType().equals(type) || PsiTypes.charType() .equals(type)) { return false; } } if (type instanceof PsiClassType) { if (!suggestEnumSwitches && TypeConversionUtil.isEnumType(type)) { return false; } Nullability nullability = getNullability(switchExpression); if (HighlightingFeature.PATTERNS_IN_SWITCH.isAvailable(switchExpression) && !ClassUtils.isPrimitive(switchExpression.getType())) { if (hasDefaultElse(ifStatement) || findNullCheckedOperand(ifStatement) != null || hasUnconditionalPatternCheck(ifStatement, switchExpression)) { nullability = Nullability.NOT_NULL; } } if (nullability == Nullability.NULLABLE) { return false; } if (onlySuggestNullSafe && nullability != Nullability.NOT_NULL) { return false; } } return !SideEffectChecker.mayHaveSideEffects(switchExpression); }