Integrated: JDK-8267690: Revisit (Doc)Tree search implemented by throwing an exception

Jonathan Gibbons jjg at
Mon Apr 25 20:58:57 UTC 2022

On Fri, 22 Apr 2022 19:10:38 GMT, Jonathan Gibbons <jjg at> wrote:

> Please review a moderately simple cleanup change, to eliminate using an exception to terminate scanning a `Tree` or `DocTree` in `(Doc)TreePath.getPath`.
> The change is to set a field with the intended result, and once that field is set, do "best-effort" to eliminate any additional scanning.
> It is easy enough to stop scanning items in a list, but it is not practical to totally stop scanning the subsequent sibling nodes, but we can substantially reduce the cost of scanning those nodes, and can definitely avoid scanning any children of those nodes.

This pull request has now been integrated.

Changeset: 80a7f7be
Author:    Jonathan Gibbons <jjg at>
Stats:     69 lines in 2 files changed: 26 ins; 9 del; 34 mod

8267690: Revisit (Doc)Tree search implemented by throwing an exception

Reviewed-by: vromero, prappo



More information about the compiler-dev mailing list