Fix circular references in exceptions - #4249
Conversation
ramanathan1504
left a comment
There was a problem hiding this comment.
@vy I reverted each production hunk locally and the cyclic cases are real: JPA converter → StackOverflow, NoSqlDatabaseManagerTest → OutOfMemoryError after 100s, Throwables.getRootCause → r instead of r_c_c.
ThrowableExtendedStackTraceRenderer.java:115 — reverting only this hunk leaves all 1,643 pattern-converter tests green; TestFriendlyException is a single class so classResourceInfoByName comes out identical either way. Can one be made to fail without it, or is it defensive only?
ThrowableProxy.java:119 — causeVisited never gets the root added, so a.initCause(b); b.initCause(a) prints Caused by: java.lang.Exception: A twice where %xEx prints [CIRCULAR REFERENCE: ...]. Out of scope here?
src/changelog/.2.x.x/4249_fix-circular-exception.xml — link #3933 too, the way the #4133 entry does?
Fix
Throwablecausal-chain handling for cyclic and identity-malfunctioning exceptions.