boolean (@Nullable UCallExpression expression) { if (expression == null) return false; UExpression receiver = expression.getReceiver(); if (receiver == null) return false; if (receiver instanceof ULiteralExpression) { return isNonNlsStringLiteral((ULiteralExpression)receiver); } if (receiver instanceof USimpleNameReferenceExpression) { // reference to variable/field/parameter return isReferenceToNonNlsElement((USimpleNameReferenceExpression)receiver); } if (receiver instanceof UCallExpression || receiver instanceof UQualifiedReferenceExpression) { // call chain PsiElement resolved = ((UResolvable)receiver).resolve(); return resolved != null && isNonNlsAnnotatedPsi(resolved); } UElement expressionParent = expression.getUastParent(); if (expressionParent instanceof UVariable && isNonNlsAnnotated(expressionParent)) { // initialized field/variable return true; } //TODO other cases? return false; }