@Test public void testApplyProxyNormal() { SeverityComparator a = new SeverityComparator(); Throwable next = this.headIeChain(new AssertionError()); next = new UndeclaredThrowableException(next); Throwable reduced = a.apply(next); assertEquals(InterruptedException.class, reduced.getClass()); }
public Throwable apply(final Throwable chain) { int limit = 0; Throwable root = chain; Throwable high = null; Throwable normal = null; for (Throwable cause = chain; cause != null; cause = cause.getCause()) { root = cause; if (isNormal(cause)) { normal = cause; } if (normal == null && cause instanceof Error) { high = cause; } if (++limit == (1 << 16)) { break; } } return high != null ? high : normal != null ? normal : root; }
SeverityComparator implements Comparator<LogRecord>, Serializable { public Throwable apply(final Throwable chain) { int limit = 0; Throwable root = chain; Throwable high = null; Throwable normal = null; for (Throwable cause = chain; cause != null; cause = cause.getCause()) { root = cause; if (isNormal(cause)) { normal = cause; } if (normal == null && cause instanceof Error) { high = cause; } if (++limit == (1 << 16)) { break; } } return high != null ? high : normal != null ? normal : root; } }
SeverityComparator implements Comparator<LogRecord>, Serializable { public Throwable apply(final Throwable chain) { int limit = 0; Throwable root = chain; Throwable high = null; Throwable normal = null; for (Throwable cause = chain; cause != null; cause = cause.getCause()) { root = cause; if (isNormal(cause)) { normal = cause; } if (normal == null && cause instanceof Error) { high = cause; } if (++limit == (1 << 16)) { break; } } return high != null ? high : normal != null ? normal : root; }  }
SeverityComparator implements Comparator<LogRecord>, Serializable { public Throwable apply(final Throwable chain) { int limit = 0; Throwable root = chain; Throwable high = null; Throwable normal = null; for (Throwable cause = chain; cause != null; cause = cause.getCause()) { root = cause; if (isNormal(cause)) { normal = cause; } if (normal == null && cause instanceof Error) { high = cause; } if (++limit == (1 << 16)) { break; } } return high != null ? high : normal != null ? normal : root; }  Throwable apply(final Throwable chain); final int applyThenCompare(Throwable tc1, Throwable tc2); int compareThrowable(final Throwable t1, final Throwable t2); int compare(final LogRecord o1, final LogRecord o2); @Override boolean equals(final Object o); @Override int hashCode(); boolean isNormal(final Throwable t); }
SeverityComparator implements Comparator<LogRecord>, Serializable { public Throwable apply(final Throwable chain) { int limit = 0; Throwable root = chain; Throwable high = null; Throwable normal = null; for (Throwable cause = chain; cause != null; cause = cause.getCause()) { root = cause; if (isNormal(cause)) { normal = cause; } if (normal == null && cause instanceof Error) { high = cause; } if (++limit == (1 << 16)) { break; } } return high != null ? high : normal != null ? normal : root; }  Throwable apply(final Throwable chain); final int applyThenCompare(Throwable tc1, Throwable tc2); int compareThrowable(final Throwable t1, final Throwable t2); int compare(final LogRecord o1, final LogRecord o2); @Override boolean equals(final Object o); @Override int hashCode(); boolean isNormal(final Throwable t);  }