alhudz commented on PR #1831: URL: https://github.com/apache/commons-lang/pull/1831#issuecomment-6394075209
You're right, I had that backwards. `make` is the top frame (index 0 of `getStackTrace()`, where both exceptions are constructed) and `main` is the bottom. Restated with the right terms: - Cause, top to bottom: `make, viaA, run, main` - Wrapper, top to bottom: `make, viaB, run, main` `removeCommonFrames` starts at the bottom and walks up. `main` and `run` match, so they're removed. That's the shared bottom run the JDK folds into `... 2 more`. Next, `viaA` and `viaB` differ. Master doesn't stop there. It keeps walking, compares `make` with `make` at the top, and removes that frame from the cause too, so the cause ends up as just `[viaA]`. The PR stops at the first difference, which means only the contiguous run from the bottom counts as common and the cause keeps `[make, viaA]`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
