PsiExpression (PsiExpressionList argumentList) { final PsiExpression[] arguments = argumentList.getExpressions(); if (arguments.length == 0) { return null; } final PsiExpression firstArgument = arguments[0]; final PsiType type = firstArgument.getType(); if (type == null) { return null; } final int formatArgumentIndex; if ("java.util.Locale".equals(type.getCanonicalText()) && arguments.length > 1) { formatArgumentIndex = 1; } else { formatArgumentIndex = 0; } return arguments[formatArgumentIndex]; }