openrewrite / rewrite-analysis

OpenRewrite recipes for data flow analysis.
Apache License 2.0
8 stars 8 forks source link

Don't stop iteration on constructor calls, only anonymous subclasses #37

Closed knutwannheden closed 9 months ago

knutwannheden commented 9 months ago

The lambda support is basically already there. What was missing for the existing LambdaTest test case was that the iteration in LocalVariableDecl#findNearestParentCallable() stopped on any constructor invocation, rather than only when iterating out of the body of an anonymous subclasses.

Fixes: #31

knutwannheden commented 9 months ago

@JLLeitschuh I went ahead and merged the PR, as it isn't clear to me to what extent you are available to review PRs. But I will be happy to fix any mistakes you detect in my PR.

JLLeitschuh commented 9 months ago

My biggest thing is just ensuring that tests exist to cover changes. It looks like you've done that, which I appreciate!

Thanks for the improvements! 🙂🎉