Skip to content

Prevent infinite recursion and StackOverflowError in ExplicitLambdaArgumentTypes - #1049

Merged
greg-at-moderne merged 1 commit into
mainfrom
greg-explicit-lambda-type-soe
Sep 4, 2026
Merged

Prevent infinite recursion and StackOverflowError in ExplicitLambdaArgumentTypes#1049
greg-at-moderne merged 1 commit into
mainfrom
greg-explicit-lambda-type-soe

Conversation

@greg-at-moderne

@greg-at-moderne greg-at-moderne commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What's changed?

Add a recursion guard in ExplicitLambdaArgumentTypes.

What's your motivation?

Prevent infinite recursion and StackOverflowError in ExplicitLambdaArgumentTypes like this:

java.lang.StackOverflowError: null org.openrewrite.staticanalysis.ExplicitLambdaArgumentTypes$1.buildTypeTree(ExplicitLambdaArgumentTypes.java:199)
 org.openrewrite.staticanalysis.ExplicitLambdaArgumentTypes$1.buildTypeParameters(ExplicitLambdaArgumentTypes.java:226)
 org.openrewrite.staticanalysis.ExplicitLambdaArgumentTypes$1.buildTypeTree(ExplicitLambdaArgumentTypes.java:131)
 org.openrewrite.staticanalysis.ExplicitLambdaArgumentTypes$1.buildTypeTree(ExplicitLambdaArgumentTypes.java:205)
 org.openrewrite.staticanalysis.ExplicitLambdaArgumentTypes$1.buildTypeParameters(ExplicitLambdaArgumentTypes.java:226)
 org.openrewrite.staticanalysis.ExplicitLambdaArgumentTypes$1.buildTypeTree(ExplicitLambdaArgumentTypes.java:131)

It might have happened for self-referential types like interface Cfg<T extends Cfg<T>>

@greg-at-moderne greg-at-moderne self-assigned this Sep 3, 2026
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Sep 3, 2026
@greg-at-moderne
greg-at-moderne marked this pull request as ready for review September 4, 2026 12:54
@greg-at-moderne
greg-at-moderne merged commit 1e3500c into main Sep 4, 2026
1 check passed
@greg-at-moderne
greg-at-moderne deleted the greg-explicit-lambda-type-soe branch September 4, 2026 12:54
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant