boolean (final PsiModifierListOwner owner) { if (owner instanceof PsiMethod) { final PsiType returnType = ((PsiMethod)owner).getReturnType(); if (returnType == null || !isStringOrStringArray(returnType)) { return false; } } else if (owner instanceof PsiVariable) { final PsiType type = ((PsiVariable)owner).getType(); if (!isStringOrStringArray(type)) { return false; } } else { return false; } return true; }