@Test public void verifyOneParameterIsHandledCorrectly() { result = MessageFormatter.format("Value is {}.", i3).getMessage(); assertEquals("Value is 3.", result); result = MessageFormatter.format("Value is {", i3).getMessage(); assertEquals("Value is {", result); result = MessageFormatter.format("{} is larger than 2.", i3).getMessage(); assertEquals("3 is larger than 2.", result); result = MessageFormatter.format("No subst", i3).getMessage(); assertEquals("No subst", result); result = MessageFormatter.format("Incorrect {subst", i3).getMessage(); assertEquals("Incorrect {subst", result); result = MessageFormatter.format("Value is {bla} {}", i3).getMessage(); assertEquals("Value is {bla} 3", result); result = MessageFormatter.format("Escaped \\{} subst", i3).getMessage(); assertEquals("Escaped {} subst", result); result = MessageFormatter.format("{Escaped", i3).getMessage(); assertEquals("{Escaped", result); result = MessageFormatter.format("\\{}Escaped", i3).getMessage(); assertEquals("{}Escaped", result); result = MessageFormatter.format("File name is {{}}.", "App folder.zip").getMessage(); assertEquals("File name is {App folder.zip}.", result); result = MessageFormatter.format("File name is C:\\\\{}.", "App folder.zip").getMessage(); assertEquals("File name is C:\\App folder.zip.", 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);  }