private static void appendSTEArray(StringBuilder sb, int indentLevel, ThrowableInfo throwableInfo, boolean extended) { ExtendedStackTraceElement[] steArray = throwableInfo.getStackTrace(); if(steArray != null) { for(ExtendedStackTraceElement ste : steArray) { if (ste == null) { continue; } appendIndent(sb, indentLevel); sb.append("at "); ste.appendTo(sb, extended); sb.append(LINE_SEPARATOR); } } int commonFrames = throwableInfo.getOmittedElements(); if(commonFrames > 0) { appendIndent(sb, indentLevel); sb.append("... ").append(commonFrames).append(" more").append(LINE_SEPARATOR); } }
private static int recursiveHashCode(ThrowableInfo instance, IdentityHashMap<ThrowableInfo, Object> dejaVu) { if(instance == null) { return 0; } if(dejaVu.containsKey(instance)) { return 0; } dejaVu.put(instance, null); int result = instance.getOmittedElements(); String name = instance.getName(); result = 29 * result + (name != null ? name.hashCode() : 0); String message = instance.getMessage(); result = 29 * result + (message != null ? message.hashCode() : 0); ThrowableInfo cause = instance.getCause(); result = 29 * result + recursiveHashCode(cause, dejaVu); ThrowableInfo[] suppressed = instance.getSuppressed(); if(suppressed != null) { for (ThrowableInfo throwableInfo : suppressed) { result = 29 * result + recursiveHashCode(throwableInfo, dejaVu); } } return result; }
StaxUtilities .writeAttribute(writer, false, prefix, NAMESPACE_URI, THROWABLE_CLASS_NAME_ATTRIBUTE, throwable.getName()); int omitted = throwable.getOmittedElements(); if(omitted != 0) .writeAttribute(writer, false, prefix, NAMESPACE_URI, OMITTED_ELEMENTS_ATTRIBUTE, Integer.toString(throwable.getOmittedElements()));