@Test public void withoutPlaceholders() { assertThat(format("Hello World!")).isEqualTo("Hello World!"); }
@Override public String format(final String message, final Object[] arguments) { int length = message.length(); StringBuilder builder = new StringBuilder(length + ADDITIONAL_STRING_BUILDER_CAPACITY); int argumentIndex = 0; for (int index = 0; index < length; ++index) { char character = message.charAt(index); if (character == '{' && index + 1 < length && message.charAt(index + 1) == '}' && argumentIndex < arguments.length) { builder.append(resolve(arguments[argumentIndex++])); index += 1; } else { builder.append(character); } } return builder.toString(); }
LegacyMessageFormatter extends AbstractMessageFormatter { @Override public String format(final String message, final Object[] arguments) { int length = message.length(); StringBuilder builder = new StringBuilder(length + ADDITIONAL_STRING_BUILDER_CAPACITY); int argumentIndex = 0; for (int index = 0; index < length; ++index) { char character = message.charAt(index); if (character == '{' && index + 1 < length && message.charAt(index + 1) == '}' && argumentIndex < arguments.length) { builder.append(resolve(arguments[argumentIndex++])); index += 1; } else { builder.append(character); } } return builder.toString(); } }
LegacyMessageFormatter extends AbstractMessageFormatter { @Override public String format(final String message, final Object[] arguments) { int length = message.length(); StringBuilder builder = new StringBuilder(length + ADDITIONAL_STRING_BUILDER_CAPACITY); int argumentIndex = 0; for (int index = 0; index < length; ++index) { char character = message.charAt(index); if (character == '{' && index + 1 < length && message.charAt(index + 1) == '}' && argumentIndex < arguments.length) { builder.append(resolve(arguments[argumentIndex++])); index += 1; } else { builder.append(character); } } return builder.toString(); } LegacyMessageFormatter(); }
LegacyMessageFormatter extends AbstractMessageFormatter { @Override public String format(final String message, final Object[] arguments) { int length = message.length(); StringBuilder builder = new StringBuilder(length + ADDITIONAL_STRING_BUILDER_CAPACITY); int argumentIndex = 0; for (int index = 0; index < length; ++index) { char character = message.charAt(index); if (character == '{' && index + 1 < length && message.charAt(index + 1) == '}' && argumentIndex < arguments.length) { builder.append(resolve(arguments[argumentIndex++])); index += 1; } else { builder.append(character); } } return builder.toString(); } LegacyMessageFormatter(); @Override String format(final String message, final Object[] arguments); }
LegacyMessageFormatter extends AbstractMessageFormatter { @Override public String format(final String message, final Object[] arguments) { int length = message.length(); StringBuilder builder = new StringBuilder(length + ADDITIONAL_STRING_BUILDER_CAPACITY); int argumentIndex = 0; for (int index = 0; index < length; ++index) { char character = message.charAt(index); if (character == '{' && index + 1 < length && message.charAt(index + 1) == '}' && argumentIndex < arguments.length) { builder.append(resolve(arguments[argumentIndex++])); index += 1; } else { builder.append(character); } } return builder.toString(); } LegacyMessageFormatter(); @Override String format(final String message, final Object[] arguments);  }