void (@NotNull PsiNewExpression expression) { if (ConstructionUtils.isReferenceTo(expression.getClassReference(), "java.text.MessageFormat")) { PsiMethod method = expression.resolveMethod(); if (method == null || !method.isConstructor()) { return; } PsiParameterList parameterList = method.getParameterList(); if (parameterList.getParametersCount() < 1) { return; } PsiParameter[] parameters = parameterList.getParameters(); if (parameters.length < 1 || parameters[0] == null) { return; } PsiType type = parameters[0].getType(); if (!CommonClassNames.JAVA_LANG_STRING.equals(type.getCanonicalText())) { return; } PsiExpressionList argumentList = expression.getArgumentList(); if (argumentList == null) { return; } checkStringFormatAndGetIndexes(argumentList.getExpressions()[0]); } }