PsiModifierListOwner (PsiExpression expression) { if (!(expression instanceof PsiReferenceExpression referenceExpression)) { return null; } if (!TypeUtils.isJavaLangString(referenceExpression.getType())) return null; final PsiElement element = referenceExpression.resolve(); if (!(element instanceof PsiModifierListOwner) || !element.isPhysical()) { return null; } return (PsiModifierListOwner)element; }