void (@NotNull PsiExpression expression, ProblemsHolder holder, boolean isAnnotationValue) { if (expression instanceof PsiConditionalExpression expr) { PsiExpression e = expr.getThenExpression(); if (e != null) { check(e, holder, isAnnotationValue); } e = expr.getElseExpression(); if (e != null) { check(e, holder, isAnnotationValue); } } else { final PsiType type = expression.getType(); // optimiziation: only check expressions of type String if (type != null && PsiUtilEx.isString(type)) { final PsiModifierListOwner element; if (isAnnotationValue) { final PsiAnnotation psiAnnotation = PsiTreeUtil.getParentOfType(expression, PsiAnnotation.class); if (psiAnnotation != null && Configuration.getInstance() .getAdvancedConfiguration().getSubstAnnotationClass().equals(psiAnnotation.getQualifiedName())) { element = PsiTreeUtil.getParentOfType(expression, PsiModifierListOwner.class); } else { return; } } else { element = AnnotationUtilEx.getAnnotatedElementFor(expression, AnnotationUtilEx.LookupType.PREFER_CONTEXT); } if (element != null && PsiUtilEx.isLanguageAnnotationTarget(element)) { PsiAnnotation[] annotations = AnnotationUtilEx.getAnnotationFrom(element, Configuration.getInstance().getAdvancedConfiguration() .getPatternAnnotationPair(), true); checkExpression(expression, annotations, holder); } } } }