INRIA / INRIA/spoon

How can one match this pattern inside CtForEach and CtLambda

Open
#5,329 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2k
Forks
392
Avg merge
11h 24m
Merged PRs (30d)
36

Description

Given snippet that looks like `list.forEach(item -> assertTrue(setBasedOnList.contains(item)));`

I would like to transform it to:

`list.forEach(item -> {});`,

such that I could insert multiple CtStatement inside the CtBlock.

Ps. I also encountered weird behavior where snippet.getElement(TypeFil... (CtForEach.class)) outputs null.

Thank you!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.