@Test public void testTwoParameters() { result = MessageFormatter.format("Value {} is smaller than {}.", i1, i2).getMessage(); assertEquals("Value 1 is smaller than 2.", result); result = MessageFormatter.format("Value {} is smaller than {}", i1, i2).getMessage(); assertEquals("Value 1 is smaller than 2", result); result = MessageFormatter.format("{}{}", i1, i2).getMessage(); assertEquals("12", result); result = MessageFormatter.format("Val1={}, Val2={", i1, i2).getMessage(); assertEquals("Val1=1, Val2={", result); result = MessageFormatter.format("Value {} is smaller than \\{}", i1, i2).getMessage(); assertEquals("Value 1 is smaller than {}", result); result = MessageFormatter.format("Value {} is smaller than \\{} tail", i1, i2).getMessage(); assertEquals("Value 1 is smaller than {} tail", result); result = MessageFormatter.format("Value {} is smaller than \\{", i1, i2).getMessage(); assertEquals("Value 1 is smaller than \\{", result); result = MessageFormatter.format("Value {} is smaller than {tail", i1, i2).getMessage(); assertEquals("Value 1 is smaller than {tail", result); result = MessageFormatter.format("Value \\{} is smaller than {}", i1, i2).getMessage(); assertEquals("Value {} is smaller than 1", result); }
final public static FormattingTuple format(String messagePattern, Object arg) { return arrayFormat(messagePattern, new Object[] { arg }); }
MessageFormatter { final public static FormattingTuple format(String messagePattern, Object arg) { return arrayFormat(messagePattern, new Object[] { arg }); } }
MessageFormatter { final public static FormattingTuple format(String messagePattern, Object arg) { return arrayFormat(messagePattern, new Object[] { arg }); }  }
MessageFormatter { final public static FormattingTuple format(String messagePattern, Object arg) { return arrayFormat(messagePattern, new Object[] { arg }); }  final static FormattingTuple format(String messagePattern, Object arg); final static FormattingTuple format(final String messagePattern, Object arg1, Object arg2); final static FormattingTuple arrayFormat(final String messagePattern, final Object[] argArray); final static String basicArrayFormat(final String messagePattern, final Object[] argArray); static String basicArrayFormat(NormalizedParameters np); final static FormattingTuple arrayFormat(final String messagePattern, final Object[] argArray, Throwable throwable); static Throwable getThrowableCandidate(final Object[] argArray); static Object[] trimmedCopy(final Object[] argArray); }
MessageFormatter { final public static FormattingTuple format(String messagePattern, Object arg) { return arrayFormat(messagePattern, new Object[] { arg }); }  final static FormattingTuple format(String messagePattern, Object arg); final static FormattingTuple format(final String messagePattern, Object arg1, Object arg2); final static FormattingTuple arrayFormat(final String messagePattern, final Object[] argArray); final static String basicArrayFormat(final String messagePattern, final Object[] argArray); static String basicArrayFormat(NormalizedParameters np); final static FormattingTuple arrayFormat(final String messagePattern, final Object[] argArray, Throwable throwable); static Throwable getThrowableCandidate(final Object[] argArray); static Object[] trimmedCopy(final Object[] argArray);  }