@Test public void testCyclicArrays() { { Object[] cyclicA = new Object[1]; cyclicA[0] = cyclicA; assertEquals("[[...]]", MessageFormatter.arrayFormat("{}", cyclicA).getMessage()); } { Object[] a = new Object[2]; a[0] = i1; Object[] c = new Object[] { i3, a }; Object[] b = new Object[] { i2, c }; a[1] = b; assertEquals("1[2, [3, [1, [...]]]]", MessageFormatter.arrayFormat("{}{}", a).getMessage()); } }
final public static FormattingTuple arrayFormat(final String messagePattern, final Object[] argArray) { Throwable throwableCandidate = MessageFormatter.getThrowableCandidate(argArray); Object[] args = argArray; if (throwableCandidate != null) { args = MessageFormatter.trimmedCopy(argArray); } return arrayFormat(messagePattern, args, throwableCandidate); }
MessageFormatter { final public static FormattingTuple arrayFormat(final String messagePattern, final Object[] argArray) { Throwable throwableCandidate = MessageFormatter.getThrowableCandidate(argArray); Object[] args = argArray; if (throwableCandidate != null) { args = MessageFormatter.trimmedCopy(argArray); } return arrayFormat(messagePattern, args, throwableCandidate); } }
MessageFormatter { final public static FormattingTuple arrayFormat(final String messagePattern, final Object[] argArray) { Throwable throwableCandidate = MessageFormatter.getThrowableCandidate(argArray); Object[] args = argArray; if (throwableCandidate != null) { args = MessageFormatter.trimmedCopy(argArray); } return arrayFormat(messagePattern, args, throwableCandidate); }  }
MessageFormatter { final public static FormattingTuple arrayFormat(final String messagePattern, final Object[] argArray) { Throwable throwableCandidate = MessageFormatter.getThrowableCandidate(argArray); Object[] args = argArray; if (throwableCandidate != null) { args = MessageFormatter.trimmedCopy(argArray); } return arrayFormat(messagePattern, args, throwableCandidate); }  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 arrayFormat(final String messagePattern, final Object[] argArray) { Throwable throwableCandidate = MessageFormatter.getThrowableCandidate(argArray); Object[] args = argArray; if (throwableCandidate != null) { args = MessageFormatter.trimmedCopy(argArray); } return arrayFormat(messagePattern, args, throwableCandidate); }  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);  }