String (@NotNull String pattern, @NotNull MessageFormatUtil.MessageFormatError error) { if (error.fromIndex() < 0 || error.toIndex() > pattern.length() || error.toIndex() < error.fromIndex()) { return null; } return pattern.substring(error.fromIndex(), error.toIndex()); }