RFR: 7903145: Cleanup TreeMaker

Athijegannathan Sundararajan sundar at openjdk.java.net
Wed Apr 6 13:40:01 UTC 2022


On Wed, 6 Apr 2022 10:18:43 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> This patch flattens the code in TreeMaker. The code uses several functional interfaces to abstract over the fact that a certain "tree" has to be created with or without a layout. This patch makes the code simpler, by adding general ways to construct scoped and variable declarations (e.g. from a kind) and by dropping the functional interfaces/method reference factory indirection.

LGTM

src/main/java/org/openjdk/jextract/Declaration.java line 537:

> 535:      */
> 536:     static Declaration.Scoped scoped(Scoped.Kind kind, Position pos, String name, Declaration... decls) {
> 537:         List<Declaration> declList = Stream.of(decls).collect(Collectors.toList());

Can we use Arrays.asList(decls) here?

src/main/java/org/openjdk/jextract/Declaration.java line 537:

> 535:      */
> 536:     static Declaration.Scoped scoped(Scoped.Kind kind, Position pos, String name, Declaration... decls) {
> 537:         List<Declaration> declList = Stream.of(decls).collect(Collectors.toList());

Can we use Arrays.asList(decls) here?

src/main/java/org/openjdk/jextract/Declaration.java line 551:

> 549:      */
> 550:     static Declaration.Scoped scoped(Scoped.Kind kind, Position pos, String name, MemoryLayout layout, Declaration... decls) {
> 551:         List<Declaration> declList = Stream.of(decls).collect(Collectors.toList());

can we use Arrays.asList(decls) here?

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

Marked as reviewed by sundar (no project role).

PR: https://git.openjdk.java.net/jextract/pull/13


More information about the jextract-dev mailing list