@Nullable
      private List<MessageFormatUtil.MessageFormatPlaceholder> checkStringFormatAndGetIndexes(@Nullable PsiExpression expression) {
        if (expression == null) {
          return null;
        }
        boolean immediatePattern = true;
        String pattern = null;

        if (expression instanceof PsiLiteralExpression literalExpression) {
          pattern = literalExpression.getText();
        }

        if (pattern == null &&
            expression instanceof PsiReferenceExpression referenceExpression &&
            referenceExpression.resolve() instanceof PsiVariable variable &&
            variable.hasModifierProperty(PsiModifier.FINAL)) {
          PsiExpression initializer = variable.getInitializer();
          if (initializer instanceof PsiLiteralExpression literalExpression) {
            pattern = literalExpression.getText();
            expression = initializer;
          }
        }
        if (pattern == null) {
          immediatePattern = false;
          CommonDataflow.DataflowResult dataflowResult = CommonDataflow.getDataflowResult(expression);
          if (dataflowResult == null) return null;
          Set<Object> values = dataflowResult.getExpressionValues(expression);
          if (values.size() != 1) return null;
          if (!(values.iterator().next() instanceof String value)) {
            return null;
          }
          pattern = value;
        }

        MessageFormatUtil.MessageFormatResult result = MessageFormatUtil.checkFormat(pattern);
        if (result.valid()) {
          return result.placeholders();
        }

        if (!immediatePattern) {
          Optional<MessageFormatUtil.MessageFormatError> toHighlight =
            result.errors().stream()
              .filter(t -> t.errorType().getSeverity().ordinal() <= MessageFormatUtil.ErrorSeverity.WARNING.ordinal())
              .min(Comparator.comparing(t -> t.errorType().getSeverity()));
          if (toHighlight.isEmpty()) {
            return null;
          }
          MessageFormatUtil.MessageFormatError error = toHighlight.get();
          createError(expression, error, pattern, 0, expression.getTextLength());
        }
        else {
          for (MessageFormatUtil.MessageFormatError error : result.errors()) {
            createError(expression, error, pattern, -1, 0);
          }
        }

        if (!ContainerUtil.exists(result.errors(),
                                  error -> error.errorType().getSeverity() == MessageFormatUtil.ErrorSeverity.RUNTIME_EXCEPTION)) {
          return result.placeholders();
        }
        return null;
      }
@Nullable
      private List<MessageFormatUtil.MessageFormatPlaceholder> checkStringFormatAndGetIndexes(@Nullable PsiExpression expression)