Skip to content

Changed implementation in FallThroughVisitor to detect infinite loops#581

Merged
timtebeek merged 16 commits into
mainfrom
1227-medhost-reports-adding-a-break-to-case-statements-still-transforms-into-non-compiling-code
Jun 4, 2025
Merged

Changed implementation in FallThroughVisitor to detect infinite loops#581
timtebeek merged 16 commits into
mainfrom
1227-medhost-reports-adding-a-break-to-case-statements-still-transforms-into-non-compiling-code

Conversation

@JohannisK
Copy link
Copy Markdown
Contributor

@JohannisK JohannisK commented Jun 2, 2025

What's changed?

Changed implementation in FallThroughVisitor to infinite loops

What's your motivation?

The logic checked for infinite loops with a guaranteed return statement.
The return statement does not change the behavior, just the fact that the condition is infinite and there is no break.

Modified the logic to accommodate.

Additional context

@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Jun 2, 2025
github-actions[bot]

This comment was marked as spam.

@timtebeek timtebeek added the bug Something isn't working label Jun 2, 2025
Comment thread src/main/java/org/openrewrite/staticanalysis/FallThroughVisitor.java Outdated
timtebeek and others added 4 commits June 2, 2025 11:49
…statements-still-transforms-into-non-compiling-code
…still-transforms-into-non-compiling-code' of github.com:openrewrite/rewrite-static-analysis into 1227-medhost-reports-adding-a-break-to-case-statements-still-transforms-into-non-compiling-code
Comment thread src/main/java/org/openrewrite/staticanalysis/FallThroughVisitor.java Outdated
@openrewrite openrewrite deleted a comment from Jenson3210 Jun 4, 2025
…r.java

Co-authored-by: Jacob van Lingen <jacobvanlingen@hotmail.com>
Comment thread src/main/java/org/openrewrite/staticanalysis/FallThroughVisitor.java Outdated
Comment thread src/main/java/org/openrewrite/staticanalysis/FallThroughVisitor.java Outdated
@github-project-automation github-project-automation Bot moved this from In Progress to Ready to Review in OpenRewrite Jun 4, 2025
Comment thread src/main/java/org/openrewrite/staticanalysis/FallThroughVisitor.java Outdated
@timtebeek
Copy link
Copy Markdown
Member

Thanks all!

@timtebeek timtebeek merged commit 4fa6686 into main Jun 4, 2025
2 checks passed
@timtebeek timtebeek deleted the 1227-medhost-reports-adding-a-break-to-case-statements-still-transforms-into-non-compiling-code branch June 4, 2025 20:55
@github-project-automation github-project-automation Bot moved this from Ready to Review to Done in OpenRewrite Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants