boolean (PsiExpression expression, LanguageLevel languageLevel) { if (expression == null) { return false; } final PsiType type = expression.getType(); if (PsiTypes.charType().equals(type) || PsiTypes.byteType().equals(type) || PsiTypes.shortType().equals(type) || PsiTypes.intType() .equals(type)) { return true; } else if (type instanceof PsiClassType && languageLevel.isAtLeast(LanguageLevel.JDK_1_5)) { if (type.equalsToText(CommonClassNames.JAVA_LANG_CHARACTER) || type.equalsToText(CommonClassNames.JAVA_LANG_BYTE) || type.equalsToText(CommonClassNames.JAVA_LANG_SHORT) || type.equalsToText(CommonClassNames.JAVA_LANG_INTEGER)) { return true; } if (TypeConversionUtil.isEnumType(type)) { return true; } if (languageLevel.isAtLeast(LanguageLevel.JDK_1_7) && type.equalsToText(CommonClassNames.JAVA_LANG_STRING)) { return true; } return HighlightingFeature.PATTERNS_IN_SWITCH.isAvailable(expression); } return false; }