private static void collectThrowableNamesRecursive(ThrowableInfo throwable, IdentityHashMap<ThrowableInfo, String> dejaVu) { if(throwable == null) { return; } if(dejaVu.containsKey(throwable)) { return; } dejaVu.put(throwable, throwable.getName()); collectThrowableNamesRecursive(throwable.getCause(), dejaVu); ThrowableInfo[] suppressed = throwable.getSuppressed(); if(suppressed == null) { return; } for (ThrowableInfo current : suppressed) { collectThrowableNamesRecursive(current, dejaVu); } }
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; }
ThrowableInfo[] suppressed = throwableInfo.getSuppressed(); if(suppressed != null)
ThrowableInfo[] suppressed = throwable.getSuppressed(); if(suppressed != null)
writeStackTraceNode(writer, prefix, throwable.getStackTrace(), STACK_TRACE_NODE); ThrowableInfo[] suppressed = throwable.getSuppressed(); if(suppressed != null)