| 48 | private static final int EXPECTED_STACK_DEPTH = 4; |
| 49 | |
| 50 | private static void addCallLocation(StringBuilder stringBuilder, int additonalCallDepth) { |
| 51 | int callDepth = EXPECTED_STACK_DEPTH + additonalCallDepth; |
| 52 | StackTraceElement[] elements = Thread.currentThread() |
| 53 | .getStackTrace(); |
| 54 | if (elements.length >= callDepth) { |
| 55 | StackTraceElement element = elements[callDepth]; |
| 56 | String text = "(" + element.getFileName() + ":" + element.getLineNumber() + ")"; |
| 57 | stringBuilder.append(text); |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | private static void adjustMinimalIndent(StringBuilder stringBuilder) { |
| 62 | while (minimalIndent < stringBuilder.length() + 1) { |