PsiExpression (@NotNull final PsiExpressionList stringFormatArgs) { final PsiExpression firstFormatArg = stringFormatArgs.getExpressions()[0]; if (firstFormatArg == null) return null; final PsiType firstType = firstFormatArg.getType(); if (firstType == null) return null; if (firstType.equalsToText(Locale.class.getName())) { if (stringFormatArgs.getExpressionCount() <= 1) return null; final PsiExpression secondFormatArg = stringFormatArgs.getExpressions()[1]; if (secondFormatArg == null) return null; final PsiType secondType = secondFormatArg.getType(); if (secondType == null || !secondType.equalsToText(String.class.getName())) return null; return secondFormatArg; } else if (firstType.equalsToText(String.class.getName())) { return firstFormatArg; } return null; }