[code-reflection] RFR: Stream code elements

Paul Sandoz psandoz at openjdk.org
Fri Feb 16 19:12:27 UTC 2024


Add a method to `CodeElement`, `elements`, that returns a stream of code elements sorted topologically in pre-order traversal.

This in many ways is superior to the existing `traverse` method. Using a gatherer it should be possible to short circuit the traversal (which requires throwing a runtime exception when using the `traverse` method).

-------------

Commit messages:
 - Stream code elements.

Changes: https://git.openjdk.org/babylon/pull/27/files
 Webrev: https://webrevs.openjdk.org/?repo=babylon&pr=27&range=00
  Stats: 120 lines in 2 files changed: 120 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/babylon/pull/27.diff
  Fetch: git fetch https://git.openjdk.org/babylon.git pull/27/head:pull/27

PR: https://git.openjdk.org/babylon/pull/27


More information about the babylon-dev mailing list